Skip to content

Conversation

@danny0405
Copy link
Contributor

#12360 What is the purpose of the change

Add JSON document for new JSON row data format.

Brief change log

  • Add json.md and json.zh.md

Verifying this change

Build locally and works fine.

image

@flinkbot
Copy link
Collaborator

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Automated Checks

Last check on commit 9bd1f86 (Wed Jun 10 07:45:37 UTC 2020)

✅no warnings

Mention the bot in a comment to re-run the automated checks.

Review Progress

  • ❓ 1. The [description] looks good.
  • ❓ 2. There is [consensus] that the contribution should go into to Flink.
  • ❓ 3. Needs [attention] from.
  • ❓ 4. The change fits into the overall [architecture].
  • ❓ 5. Overall code [quality] is good.

Please see the Pull Request Review Guide for a full explanation of the review process.

Details
The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commands
The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

@flinkbot
Copy link
Collaborator

flinkbot commented Jun 10, 2020

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run travis re-run the last Travis build
  • @flinkbot run azure re-run the last Azure build

<tr>
<td>MAP/MULTISET</td>
<td>object
<span class="label label-danger">Note</span> Only serialization is supported.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both is supported?

</tr>
<tr>
<td>TIMESTAMP</td>
<td>string</td>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string with format: date-time

</tr>
<tr>
<td>TIME</td>
<td>string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string with format: time

</tr>
<tr>
<td>DATE</td>
<td>string</td>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string with format: date

Comment on lines 125 to 126
<td>NULL</td>
<td>null/empty</td>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NULL is not supported in Flink SQL, remove this to avoid confuses.

Comment on lines 153 to 157
<td>INT/INTERVAL_YEAR_MONTH</td>
<td>number</td>
</tr>
<tr>
<td>BIGINT/INTERVAL_DAY_TIME</td>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a new row for interval? INTERVAL_YEAR_MONTH and INTERVAL_DAY_TIME are root name, not type name. We can call them INTERVAL as they all converted to number.


Currently, the JSON schema is always derived from table schema. Explicitly defining an JSON schema is not supported yet.

Flink JSON format uses utility class `com.fasterxml.jackson.databind.node.JsonNodeFactory` (for serialization) and `com.fasterxml.jackson.databind.JsonNode` (for deserialization) provided by `jackson` to convert Flink Data Types to and from JSON data types.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flink JSON format uses [jackson databind API](https://github.com/FasterXML/jackson-databind) to parse and generate JSON string. 

<td>Specify what format to use, here should be 'json'.</td>
</tr>
<tr>
<td><h5>fail-on-missing-field</h5></td>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to use json.fail-on-missing-field as the option key, because this is all the current connector how to use it.

'topic' = 'user_behavior',
'properties.bootstrap.servers' = 'localhost:9092',
'properties.group.id' = 'testGroup',
'format' = 'json'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'format' = 'json'
'format' = 'json',
'json.fail-on-missing-field' = 'false',
'json.ignore-parse-errors' = 'true'

I suggest to list some of the options, otherwise, users may still don't know how to use it.


| Maven dependency | SQL Client JAR |
| :----------------- | :----------------------|
| `flink-json` | The `flink-json-{{site.version}}.jar` is a built-in jar of SQL-CLI. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `flink-json` | The `flink-json-{{site.version}}.jar` is a built-in jar of SQL-CLI. |
| `flink-json` | Built-in |

Copy link
Member

@wuchong wuchong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick updating. LGTM.

@wuchong
Copy link
Member

wuchong commented Jun 11, 2020

The failed tests are not related to this PR, merging...

@wuchong wuchong merged commit aaf6da0 into apache:master Jun 11, 2020
wuchong pushed a commit that referenced this pull request Jun 11, 2020
zhangjun0x01 pushed a commit to zhangjun0x01/flink that referenced this pull request Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants