You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/01/20 14:59:03 UTC

[GitHub] [flink] dawidwys opened a new pull request #10909: [FLINK-15686][sql-client] Use old type system in CollectStreamTableSink

dawidwys opened a new pull request #10909: [FLINK-15686][sql-client] Use old type system in CollectStreamTableSink
URL: https://github.com/apache/flink/pull/10909
 
 
   ## What is the purpose of the change
   
   Fix mismatch between a declared logical schema  with a declared physical schema of a `CollectStreamTableSink`.
   
   ## Brief change log
   
     - Do not pass around a `RowType` in sql-client as it contains duplicated information with `TableSchema`
     - Use legacy types in `CollectStreamTableSink#getTableSchema` via `CollectStreamTableSink#getFieldTypes` & `CollectStreamTableSink#getFieldNames`
   
   
   ## Verifying this change
   
   Extended tests in `LocalExecutorITCase` to include a problematic `CHAR(3)` coming from a string literal in a result of a query.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (yes / **no**)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes / **no**)
     - The serializers: (yes / **no** / don't know)
     - The runtime per-record code paths (performance sensitive): (yes / **no** / don't know)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (yes / **no** / don't know)
     - The S3 file system connector: (yes / **no** / don't know)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (yes / **no**)
     - If yes, how is the feature documented? (**not applicable** / docs / JavaDocs / not documented)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot commented on issue #10909: [FLINK-15686][sql-client] Use old type system in CollectStreamTableSink

Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #10909: [FLINK-15686][sql-client] Use old type system in CollectStreamTableSink
URL: https://github.com/apache/flink/pull/10909#issuecomment-576313737
 
 
   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 7dd83c10a8fd98e21c6982b3ae2e0bd1d597e8ea (Mon Jan 20 15:05:00 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## 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](https://flink.apache.org/contributing/reviewing-prs.html) 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 <summary>Bot commands</summary>
     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
   </details>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #10909: [FLINK-15686][sql-client] Use old type system in CollectStreamTableSink

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10909: [FLINK-15686][sql-client] Use old type system in CollectStreamTableSink
URL: https://github.com/apache/flink/pull/10909#issuecomment-576376827
 
 
   <!--
   Meta data
   Hash:7dd83c10a8fd98e21c6982b3ae2e0bd1d597e8ea Status:FAILURE URL:https://travis-ci.com/flink-ci/flink/builds/145244513 TriggerType:PUSH TriggerID:7dd83c10a8fd98e21c6982b3ae2e0bd1d597e8ea
   Hash:7dd83c10a8fd98e21c6982b3ae2e0bd1d597e8ea Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4509 TriggerType:PUSH TriggerID:7dd83c10a8fd98e21c6982b3ae2e0bd1d597e8ea
   -->
   ## CI report:
   
   * 7dd83c10a8fd98e21c6982b3ae2e0bd1d597e8ea Travis: [FAILURE](https://travis-ci.com/flink-ci/flink/builds/145244513) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4509) 
   
   <details>
   <summary>Bot commands</summary>
     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
   </details>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] JingsongLi commented on a change in pull request #10909: [FLINK-15686][sql-client] Use old type system in CollectStreamTableSink

Posted by GitBox <gi...@apache.org>.
JingsongLi commented on a change in pull request #10909: [FLINK-15686][sql-client] Use old type system in CollectStreamTableSink
URL: https://github.com/apache/flink/pull/10909#discussion_r368788817
 
 

 ##########
 File path: flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/CollectStreamTableSink.java
 ##########
 @@ -43,21 +43,32 @@
 	private final TypeSerializer<Tuple2<Boolean, Row>> serializer;
 	private final TableSchema tableSchema;
 
-	public CollectStreamTableSink(InetAddress targetAddress, int targetPort, TypeSerializer<Tuple2<Boolean, Row>> serializer, TableSchema tableSchema) {
+	public CollectStreamTableSink(
+			InetAddress targetAddress,
+			int targetPort,
+			TypeSerializer<Tuple2<Boolean, Row>> serializer,
+			TableSchema tableSchema) {
 		this.targetAddress = targetAddress;
 		this.targetPort = targetPort;
 		this.serializer = serializer;
 		this.tableSchema = TableSchemaUtils.checkNoGeneratedColumns(tableSchema);
 
 Review comment:
   Can we override `getTableSchema` directly:
   ```
       @Override
   	public TableSchema getTableSchema() {
   		// We use the old type system here to be consistent with getRecordType.
   		return new TableSchema(tableSchema.getFieldNames(), tableSchema.getFieldTypes());
   	}
   ```
   I think `getFieldNames` and `getFieldTypes` is not so intuitive.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] dawidwys commented on a change in pull request #10909: [FLINK-15686][sql-client] Use old type system in CollectStreamTableSink

Posted by GitBox <gi...@apache.org>.
dawidwys commented on a change in pull request #10909: [FLINK-15686][sql-client] Use old type system in CollectStreamTableSink
URL: https://github.com/apache/flink/pull/10909#discussion_r368864607
 
 

 ##########
 File path: flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/CollectStreamTableSink.java
 ##########
 @@ -43,21 +43,32 @@
 	private final TypeSerializer<Tuple2<Boolean, Row>> serializer;
 	private final TableSchema tableSchema;
 
-	public CollectStreamTableSink(InetAddress targetAddress, int targetPort, TypeSerializer<Tuple2<Boolean, Row>> serializer, TableSchema tableSchema) {
+	public CollectStreamTableSink(
+			InetAddress targetAddress,
+			int targetPort,
+			TypeSerializer<Tuple2<Boolean, Row>> serializer,
+			TableSchema tableSchema) {
 		this.targetAddress = targetAddress;
 		this.targetPort = targetPort;
 		this.serializer = serializer;
 		this.tableSchema = TableSchemaUtils.checkNoGeneratedColumns(tableSchema);
 
 Review comment:
   I could not decide on those two options myself. 
   
   I went for the `getFieldNames` and `getFieldTypes` methods because I thought it will be easier to track it back when fixing the `Upsert/RetractTableSink` interfaces. I thought it will be more visible that we need to fix it here as well when removing those methods. I am afraid the old type system in `TableSchema` might stick around for a bit longer than these methods. Moreover it is also how we do it e.g. in Elasticsearch retract stream.
   
   But I am fine with switching over to `TableSchema` if you think it would be better that way.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] dawidwys commented on issue #10909: [FLINK-15686][sql-client] Use old type system in CollectStreamTableSink

Posted by GitBox <gi...@apache.org>.
dawidwys commented on issue #10909: [FLINK-15686][sql-client] Use old type system in CollectStreamTableSink
URL: https://github.com/apache/flink/pull/10909#issuecomment-576311505
 
 
   Could you have a look @twalthr?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] JingsongLi commented on a change in pull request #10909: [FLINK-15686][sql-client] Use old type system in CollectStreamTableSink

Posted by GitBox <gi...@apache.org>.
JingsongLi commented on a change in pull request #10909: [FLINK-15686][sql-client] Use old type system in CollectStreamTableSink
URL: https://github.com/apache/flink/pull/10909#discussion_r368872147
 
 

 ##########
 File path: flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/CollectStreamTableSink.java
 ##########
 @@ -43,21 +43,32 @@
 	private final TypeSerializer<Tuple2<Boolean, Row>> serializer;
 	private final TableSchema tableSchema;
 
-	public CollectStreamTableSink(InetAddress targetAddress, int targetPort, TypeSerializer<Tuple2<Boolean, Row>> serializer, TableSchema tableSchema) {
+	public CollectStreamTableSink(
+			InetAddress targetAddress,
+			int targetPort,
+			TypeSerializer<Tuple2<Boolean, Row>> serializer,
+			TableSchema tableSchema) {
 		this.targetAddress = targetAddress;
 		this.targetPort = targetPort;
 		this.serializer = serializer;
 		this.tableSchema = TableSchemaUtils.checkNoGeneratedColumns(tableSchema);
 
 Review comment:
   Sounds reasonable to me. I don't have a strong tendency.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] dawidwys merged pull request #10909: [FLINK-15686][sql-client] Use old type system in CollectStreamTableSink

Posted by GitBox <gi...@apache.org>.
dawidwys merged pull request #10909: [FLINK-15686][sql-client] Use old type system in CollectStreamTableSink
URL: https://github.com/apache/flink/pull/10909
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot commented on issue #10909: [FLINK-15686][sql-client] Use old type system in CollectStreamTableSink

Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #10909: [FLINK-15686][sql-client] Use old type system in CollectStreamTableSink
URL: https://github.com/apache/flink/pull/10909#issuecomment-576376827
 
 
   <!--
   Meta data
   Hash:7dd83c10a8fd98e21c6982b3ae2e0bd1d597e8ea Status:UNKNOWN URL:TBD TriggerType:PUSH TriggerID:7dd83c10a8fd98e21c6982b3ae2e0bd1d597e8ea
   -->
   ## CI report:
   
   * 7dd83c10a8fd98e21c6982b3ae2e0bd1d597e8ea UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     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
   </details>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services