-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-18131][doc] Add documentation for the new JSON format #12574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast 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
Please see the Pull Request Review Guide for a full explanation of the review process. DetailsThe 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 commandsThe @flinkbot bot supports the following commands:
|
| <tr> | ||
| <td>MAP/MULTISET</td> | ||
| <td>object | ||
| <span class="label label-danger">Note</span> Only serialization is supported. |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
string with format: date
| <td>NULL</td> | ||
| <td>null/empty</td> |
There was a problem hiding this comment.
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.
| <td>INT/INTERVAL_YEAR_MONTH</td> | ||
| <td>number</td> | ||
| </tr> | ||
| <tr> | ||
| <td>BIGINT/INTERVAL_DAY_TIME</td> |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| '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. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| | `flink-json` | The `flink-json-{{site.version}}.jar` is a built-in jar of SQL-CLI. | | |
| | `flink-json` | Built-in | |
wuchong
left a comment
There was a problem hiding this 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.
|
The failed tests are not related to this PR, merging... |
#12360 What is the purpose of the change
Add JSON document for new JSON row data format.
Brief change log
Verifying this change
Build locally and works fine.