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/07/10 06:02:35 UTC

[GitHub] [flink] JingsongLi opened a new pull request #12864: [FLINK-18487][table] Datagen and Blackhole factory omits unrecognized properties silently

JingsongLi opened a new pull request #12864:
URL: https://github.com/apache/flink/pull/12864


   
   ## What is the purpose of the change
   
   For the following DDL, we just omits the unrecognized property 'records-per-second'.
   ```
   CREATE TABLE MyDataGen (
     int_field int,
     double_field double,
     string_field varchar
   ) WITH (
     'connector' = 'datagen',
     'records-per-second' = '1'  -- should be rows-per-second
   )
   ``
   We should throw Exceptions to tell users that they used a wrong property.
   
   ## Brief change log
   
   - `DataGenTableSourceFactory`: Dynamic generation config options, validate them, and check unconsumed keys.
   - `BlackHoleTableSinkFactory`: Using helper.validate.
   
   ## Verifying this change
   
   - `DataGeneratorSourceTest`
   - `BlackHoleSinkFactoryTest`
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no
     - The serializers: (no
     - The runtime per-record code paths (performance sensitive): no
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (no
     - The S3 file system connector: (no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (no


----------------------------------------------------------------
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



[GitHub] [flink] lirui-apache commented on a change in pull request #12864: [FLINK-18487][table] Datagen and Blackhole factory omits unrecognized properties silently

Posted by GitBox <gi...@apache.org>.
lirui-apache commented on a change in pull request #12864:
URL: https://github.com/apache/flink/pull/12864#discussion_r457861642



##########
File path: flink-table/flink-table-api-java-bridge/src/main/java/org/apache/flink/table/factories/DataGenTableSourceFactory.java
##########
@@ -94,128 +97,176 @@ public String factoryIdentifier() {
 
 	@Override
 	public DynamicTableSource createDynamicTableSource(Context context) {
+		createTableFactoryHelper(this, context).validateExcept(FIELDS);

Review comment:
       Is this necessary, given that we'll call `FactoryUtil.validateFactoryOptions` and `FactoryUtil.validateUnconsumedKeys` later on?

##########
File path: flink-table/flink-table-api-java-bridge/src/main/java/org/apache/flink/table/factories/DataGenTableSourceFactory.java
##########
@@ -94,128 +97,176 @@ public String factoryIdentifier() {
 
 	@Override
 	public DynamicTableSource createDynamicTableSource(Context context) {
+		createTableFactoryHelper(this, context).validateExcept(FIELDS);
+
 		Configuration options = new Configuration();
 		context.getCatalogTable().getOptions().forEach(options::setString);
 
-		TableSchema tableSchema = TableSchemaUtils.getPhysicalSchema(context.getCatalogTable().getSchema());
+		TableSchema schema = TableSchemaUtils.getPhysicalSchema(context.getCatalogTable().getSchema());
+		DataGenerator[] fieldGenerators = new DataGenerator[schema.getFieldCount()];
+		Set<ConfigOption<?>> optionalOptions = new HashSet<>();
 
-		DataGenerator[] fieldGenerators = new DataGenerator[tableSchema.getFieldCount()];
 		for (int i = 0; i < fieldGenerators.length; i++) {
-			fieldGenerators[i] = createDataGenerator(
-					tableSchema.getFieldName(i).get(),
-					tableSchema.getFieldDataType(i).get(),
-					options);
+			String name = schema.getFieldNames()[i];
+			DataType type = schema.getFieldDataTypes()[i];
+
+			ConfigOption<String> kind = key(FIELDS + "." + name + "." + KIND)
+					.stringType().defaultValue(RANDOM);
+			DataGeneratorContainer container = createContainer(name, type, options.get(kind), options);
+			fieldGenerators[i] = container.generator;
+
+			optionalOptions.add(kind);
+			optionalOptions.addAll(container.options);
 		}
 
-		return new DataGenTableSource(fieldGenerators, tableSchema, options.get(ROWS_PER_SECOND));
+		FactoryUtil.validateFactoryOptions(new HashSet<>(), optionalOptions, options);
+
+		Set<String> consumedOptionKeys = new HashSet<>();
+		consumedOptionKeys.add(CONNECTOR.key());
+		consumedOptionKeys.add(ROWS_PER_SECOND.key());
+		optionalOptions.stream().map(ConfigOption::key).forEach(consumedOptionKeys::add);
+		FactoryUtil.validateUnconsumedKeys(factoryIdentifier(), options.keySet(), consumedOptionKeys);
+
+		return new DataGenTableSource(fieldGenerators, schema, options.get(ROWS_PER_SECOND));
 	}
 
-	private DataGenerator createDataGenerator(String name, DataType type, ReadableConfig options) {
-		String genType = options.get(
-				key(FIELDS + "." + name + "." + KIND).stringType().defaultValue(RANDOM));
-		switch (genType) {
+	private DataGeneratorContainer createContainer(
+			String name, DataType type, String kind, ReadableConfig options) {
+		switch (kind) {
 			case RANDOM:
-				return createRandomGenerator(name, type, options);
+				return createRandomContainer(name, type, options);
 			case SEQUENCE:
-				return createSequenceGenerator(name, type, options);
+				return createSequenceContainer(name, type, options);
 			default:
-				throw new ValidationException("Unsupported generator type: " + genType);
+				throw new ValidationException("Unsupported generator kind: " + kind);
 		}
 	}
 
-	private DataGenerator createRandomGenerator(String name, DataType type, ReadableConfig options) {
-		ConfigOption<Integer> lenKey = key(FIELDS + "." + name + "." + LENGTH)
-				.intType().defaultValue(100);
+	private DataGeneratorContainer createRandomContainer(String name, DataType type, ReadableConfig config) {
 		OptionBuilder minKey = key(FIELDS + "." + name + "." + MIN);
 		OptionBuilder maxKey = key(FIELDS + "." + name + "." + MAX);
 		switch (type.getLogicalType().getTypeRoot()) {
-			case BOOLEAN:
-				return RandomGenerator.booleanGenerator();
+			case BOOLEAN: {
+				return DataGeneratorContainer.of(RandomGenerator.booleanGenerator());
+			}
 			case CHAR:
-			case VARCHAR:
-				int length = options.get(lenKey);
-				return getRandomStringGenerator(length);
-			case TINYINT:
-				return RandomGenerator.byteGenerator(
-						options.get(minKey.intType().defaultValue((int) Byte.MIN_VALUE)).byteValue(),
-						options.get(maxKey.intType().defaultValue((int) Byte.MAX_VALUE)).byteValue());
-			case SMALLINT:
-				return RandomGenerator.shortGenerator(
-						options.get(minKey.intType().defaultValue((int) Short.MIN_VALUE)).shortValue(),
-						options.get(maxKey.intType().defaultValue((int) Short.MAX_VALUE)).shortValue());
-			case INTEGER:
-				return RandomGenerator.intGenerator(
-						options.get(minKey.intType().defaultValue(Integer.MIN_VALUE)),
-						options.get(maxKey.intType().defaultValue(Integer.MAX_VALUE)));
-			case BIGINT:
-				return RandomGenerator.longGenerator(
-						options.get(minKey.longType().defaultValue(Long.MIN_VALUE)),
-						options.get(maxKey.longType().defaultValue(Long.MAX_VALUE)));
-			case FLOAT:
-				return RandomGenerator.floatGenerator(
-						options.get(minKey.floatType().defaultValue(Float.MIN_VALUE)),
-						options.get(maxKey.floatType().defaultValue(Float.MAX_VALUE)));
-			case DOUBLE:
-				return RandomGenerator.doubleGenerator(
-						options.get(minKey.doubleType().defaultValue(Double.MIN_VALUE)),
-						options.get(maxKey.doubleType().defaultValue(Double.MAX_VALUE)));
+			case VARCHAR: {
+				ConfigOption<Integer> lenOption = key(FIELDS + "." + name + "." + LENGTH)
+						.intType()
+						.defaultValue(100);

Review comment:
       make the default value a static member?

##########
File path: flink-table/flink-table-api-java-bridge/src/main/java/org/apache/flink/table/factories/DataGenTableSourceFactory.java
##########
@@ -94,128 +97,176 @@ public String factoryIdentifier() {
 
 	@Override
 	public DynamicTableSource createDynamicTableSource(Context context) {
+		createTableFactoryHelper(this, context).validateExcept(FIELDS);
+
 		Configuration options = new Configuration();
 		context.getCatalogTable().getOptions().forEach(options::setString);
 
-		TableSchema tableSchema = TableSchemaUtils.getPhysicalSchema(context.getCatalogTable().getSchema());
+		TableSchema schema = TableSchemaUtils.getPhysicalSchema(context.getCatalogTable().getSchema());
+		DataGenerator[] fieldGenerators = new DataGenerator[schema.getFieldCount()];
+		Set<ConfigOption<?>> optionalOptions = new HashSet<>();
 
-		DataGenerator[] fieldGenerators = new DataGenerator[tableSchema.getFieldCount()];
 		for (int i = 0; i < fieldGenerators.length; i++) {
-			fieldGenerators[i] = createDataGenerator(
-					tableSchema.getFieldName(i).get(),
-					tableSchema.getFieldDataType(i).get(),
-					options);
+			String name = schema.getFieldNames()[i];
+			DataType type = schema.getFieldDataTypes()[i];
+
+			ConfigOption<String> kind = key(FIELDS + "." + name + "." + KIND)
+					.stringType().defaultValue(RANDOM);
+			DataGeneratorContainer container = createContainer(name, type, options.get(kind), options);
+			fieldGenerators[i] = container.generator;
+
+			optionalOptions.add(kind);
+			optionalOptions.addAll(container.options);
 		}
 
-		return new DataGenTableSource(fieldGenerators, tableSchema, options.get(ROWS_PER_SECOND));
+		FactoryUtil.validateFactoryOptions(new HashSet<>(), optionalOptions, options);
+
+		Set<String> consumedOptionKeys = new HashSet<>();
+		consumedOptionKeys.add(CONNECTOR.key());
+		consumedOptionKeys.add(ROWS_PER_SECOND.key());

Review comment:
       Do we also need to add `PROPERTY_VERSION` to `consumedOptionKeys`?

##########
File path: flink-table/flink-table-api-java-bridge/src/main/java/org/apache/flink/table/factories/DataGenTableSourceFactory.java
##########
@@ -94,128 +97,176 @@ public String factoryIdentifier() {
 
 	@Override
 	public DynamicTableSource createDynamicTableSource(Context context) {
+		createTableFactoryHelper(this, context).validateExcept(FIELDS);
+
 		Configuration options = new Configuration();
 		context.getCatalogTable().getOptions().forEach(options::setString);
 
-		TableSchema tableSchema = TableSchemaUtils.getPhysicalSchema(context.getCatalogTable().getSchema());
+		TableSchema schema = TableSchemaUtils.getPhysicalSchema(context.getCatalogTable().getSchema());
+		DataGenerator[] fieldGenerators = new DataGenerator[schema.getFieldCount()];
+		Set<ConfigOption<?>> optionalOptions = new HashSet<>();
 
-		DataGenerator[] fieldGenerators = new DataGenerator[tableSchema.getFieldCount()];
 		for (int i = 0; i < fieldGenerators.length; i++) {
-			fieldGenerators[i] = createDataGenerator(
-					tableSchema.getFieldName(i).get(),
-					tableSchema.getFieldDataType(i).get(),
-					options);
+			String name = schema.getFieldNames()[i];
+			DataType type = schema.getFieldDataTypes()[i];
+
+			ConfigOption<String> kind = key(FIELDS + "." + name + "." + KIND)
+					.stringType().defaultValue(RANDOM);
+			DataGeneratorContainer container = createContainer(name, type, options.get(kind), options);
+			fieldGenerators[i] = container.generator;
+
+			optionalOptions.add(kind);
+			optionalOptions.addAll(container.options);
 		}
 
-		return new DataGenTableSource(fieldGenerators, tableSchema, options.get(ROWS_PER_SECOND));
+		FactoryUtil.validateFactoryOptions(new HashSet<>(), optionalOptions, options);

Review comment:
       Call `requiredOptions()` instead of `new HashSet<>()`?




----------------------------------------------------------------
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



[GitHub] [flink] JingsongLi commented on a change in pull request #12864: [FLINK-18487][table] Datagen and Blackhole factory omits unrecognized properties silently

Posted by GitBox <gi...@apache.org>.
JingsongLi commented on a change in pull request #12864:
URL: https://github.com/apache/flink/pull/12864#discussion_r459326425



##########
File path: flink-table/flink-table-api-java-bridge/src/main/java/org/apache/flink/table/factories/DataGenTableSourceFactory.java
##########
@@ -94,128 +97,176 @@ public String factoryIdentifier() {
 
 	@Override
 	public DynamicTableSource createDynamicTableSource(Context context) {
+		createTableFactoryHelper(this, context).validateExcept(FIELDS);
+
 		Configuration options = new Configuration();
 		context.getCatalogTable().getOptions().forEach(options::setString);
 
-		TableSchema tableSchema = TableSchemaUtils.getPhysicalSchema(context.getCatalogTable().getSchema());
+		TableSchema schema = TableSchemaUtils.getPhysicalSchema(context.getCatalogTable().getSchema());
+		DataGenerator[] fieldGenerators = new DataGenerator[schema.getFieldCount()];
+		Set<ConfigOption<?>> optionalOptions = new HashSet<>();
 
-		DataGenerator[] fieldGenerators = new DataGenerator[tableSchema.getFieldCount()];
 		for (int i = 0; i < fieldGenerators.length; i++) {
-			fieldGenerators[i] = createDataGenerator(
-					tableSchema.getFieldName(i).get(),
-					tableSchema.getFieldDataType(i).get(),
-					options);
+			String name = schema.getFieldNames()[i];
+			DataType type = schema.getFieldDataTypes()[i];
+
+			ConfigOption<String> kind = key(FIELDS + "." + name + "." + KIND)
+					.stringType().defaultValue(RANDOM);
+			DataGeneratorContainer container = createContainer(name, type, options.get(kind), options);
+			fieldGenerators[i] = container.generator;
+
+			optionalOptions.add(kind);
+			optionalOptions.addAll(container.options);
 		}
 
-		return new DataGenTableSource(fieldGenerators, tableSchema, options.get(ROWS_PER_SECOND));
+		FactoryUtil.validateFactoryOptions(new HashSet<>(), optionalOptions, options);
+
+		Set<String> consumedOptionKeys = new HashSet<>();
+		consumedOptionKeys.add(CONNECTOR.key());
+		consumedOptionKeys.add(ROWS_PER_SECOND.key());

Review comment:
       No need. We don't have another version.




----------------------------------------------------------------
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



[GitHub] [flink] flinkbot commented on pull request #12864: [FLINK-18487][table] Datagen and Blackhole factory omits unrecognized properties silently

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #12864:
URL: https://github.com/apache/flink/pull/12864#issuecomment-656503840


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "499f80cfa226fe3cf8dbc1edc707e76b01fe1182",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "499f80cfa226fe3cf8dbc1edc707e76b01fe1182",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 499f80cfa226fe3cf8dbc1edc707e76b01fe1182 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



[GitHub] [flink] flinkbot edited a comment on pull request #12864: [FLINK-18487][table] Datagen and Blackhole factory omits unrecognized properties silently

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12864:
URL: https://github.com/apache/flink/pull/12864#issuecomment-656503840


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "499f80cfa226fe3cf8dbc1edc707e76b01fe1182",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4387",
       "triggerID" : "499f80cfa226fe3cf8dbc1edc707e76b01fe1182",
       "triggerType" : "PUSH"
     }, {
       "hash" : "00dcb531f4342280f1fd56fc89cfb921a11d01f3",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4391",
       "triggerID" : "00dcb531f4342280f1fd56fc89cfb921a11d01f3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "dc885404cf1343b8316b8574208a2ed9f862673e",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "dc885404cf1343b8316b8574208a2ed9f862673e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 00dcb531f4342280f1fd56fc89cfb921a11d01f3 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4391) 
   * dc885404cf1343b8316b8574208a2ed9f862673e 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



[GitHub] [flink] flinkbot edited a comment on pull request #12864: [FLINK-18487][table] Datagen and Blackhole factory omits unrecognized properties silently

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12864:
URL: https://github.com/apache/flink/pull/12864#issuecomment-656503840


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "499f80cfa226fe3cf8dbc1edc707e76b01fe1182",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4387",
       "triggerID" : "499f80cfa226fe3cf8dbc1edc707e76b01fe1182",
       "triggerType" : "PUSH"
     }, {
       "hash" : "00dcb531f4342280f1fd56fc89cfb921a11d01f3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4391",
       "triggerID" : "00dcb531f4342280f1fd56fc89cfb921a11d01f3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "dc885404cf1343b8316b8574208a2ed9f862673e",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4625",
       "triggerID" : "dc885404cf1343b8316b8574208a2ed9f862673e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "88f7eacc4536eecfd7149cceab463597682945fb",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4767",
       "triggerID" : "88f7eacc4536eecfd7149cceab463597682945fb",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * dc885404cf1343b8316b8574208a2ed9f862673e Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4625) 
   * 88f7eacc4536eecfd7149cceab463597682945fb Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4767) 
   
   <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



[GitHub] [flink] flinkbot commented on pull request #12864: [FLINK-18487][table] Datagen and Blackhole factory omits unrecognized properties silently

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #12864:
URL: https://github.com/apache/flink/pull/12864#issuecomment-656500646


   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 499f80cfa226fe3cf8dbc1edc707e76b01fe1182 (Fri Jul 10 06:04:18 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



[GitHub] [flink] flinkbot edited a comment on pull request #12864: [FLINK-18487][table] Datagen and Blackhole factory omits unrecognized properties silently

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12864:
URL: https://github.com/apache/flink/pull/12864#issuecomment-656503840


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "499f80cfa226fe3cf8dbc1edc707e76b01fe1182",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4387",
       "triggerID" : "499f80cfa226fe3cf8dbc1edc707e76b01fe1182",
       "triggerType" : "PUSH"
     }, {
       "hash" : "00dcb531f4342280f1fd56fc89cfb921a11d01f3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4391",
       "triggerID" : "00dcb531f4342280f1fd56fc89cfb921a11d01f3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "dc885404cf1343b8316b8574208a2ed9f862673e",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4625",
       "triggerID" : "dc885404cf1343b8316b8574208a2ed9f862673e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "88f7eacc4536eecfd7149cceab463597682945fb",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "88f7eacc4536eecfd7149cceab463597682945fb",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * dc885404cf1343b8316b8574208a2ed9f862673e Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4625) 
   * 88f7eacc4536eecfd7149cceab463597682945fb 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



[GitHub] [flink] JingsongLi commented on a change in pull request #12864: [FLINK-18487][table] Datagen and Blackhole factory omits unrecognized properties silently

Posted by GitBox <gi...@apache.org>.
JingsongLi commented on a change in pull request #12864:
URL: https://github.com/apache/flink/pull/12864#discussion_r459326425



##########
File path: flink-table/flink-table-api-java-bridge/src/main/java/org/apache/flink/table/factories/DataGenTableSourceFactory.java
##########
@@ -94,128 +97,176 @@ public String factoryIdentifier() {
 
 	@Override
 	public DynamicTableSource createDynamicTableSource(Context context) {
+		createTableFactoryHelper(this, context).validateExcept(FIELDS);
+
 		Configuration options = new Configuration();
 		context.getCatalogTable().getOptions().forEach(options::setString);
 
-		TableSchema tableSchema = TableSchemaUtils.getPhysicalSchema(context.getCatalogTable().getSchema());
+		TableSchema schema = TableSchemaUtils.getPhysicalSchema(context.getCatalogTable().getSchema());
+		DataGenerator[] fieldGenerators = new DataGenerator[schema.getFieldCount()];
+		Set<ConfigOption<?>> optionalOptions = new HashSet<>();
 
-		DataGenerator[] fieldGenerators = new DataGenerator[tableSchema.getFieldCount()];
 		for (int i = 0; i < fieldGenerators.length; i++) {
-			fieldGenerators[i] = createDataGenerator(
-					tableSchema.getFieldName(i).get(),
-					tableSchema.getFieldDataType(i).get(),
-					options);
+			String name = schema.getFieldNames()[i];
+			DataType type = schema.getFieldDataTypes()[i];
+
+			ConfigOption<String> kind = key(FIELDS + "." + name + "." + KIND)
+					.stringType().defaultValue(RANDOM);
+			DataGeneratorContainer container = createContainer(name, type, options.get(kind), options);
+			fieldGenerators[i] = container.generator;
+
+			optionalOptions.add(kind);
+			optionalOptions.addAll(container.options);
 		}
 
-		return new DataGenTableSource(fieldGenerators, tableSchema, options.get(ROWS_PER_SECOND));
+		FactoryUtil.validateFactoryOptions(new HashSet<>(), optionalOptions, options);
+
+		Set<String> consumedOptionKeys = new HashSet<>();
+		consumedOptionKeys.add(CONNECTOR.key());
+		consumedOptionKeys.add(ROWS_PER_SECOND.key());

Review comment:
       No need.




----------------------------------------------------------------
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



[GitHub] [flink] flinkbot edited a comment on pull request #12864: [FLINK-18487][table] Datagen and Blackhole factory omits unrecognized properties silently

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12864:
URL: https://github.com/apache/flink/pull/12864#issuecomment-656503840


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "499f80cfa226fe3cf8dbc1edc707e76b01fe1182",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4387",
       "triggerID" : "499f80cfa226fe3cf8dbc1edc707e76b01fe1182",
       "triggerType" : "PUSH"
     }, {
       "hash" : "00dcb531f4342280f1fd56fc89cfb921a11d01f3",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4391",
       "triggerID" : "00dcb531f4342280f1fd56fc89cfb921a11d01f3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "dc885404cf1343b8316b8574208a2ed9f862673e",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4625",
       "triggerID" : "dc885404cf1343b8316b8574208a2ed9f862673e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 00dcb531f4342280f1fd56fc89cfb921a11d01f3 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4391) 
   * dc885404cf1343b8316b8574208a2ed9f862673e Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4625) 
   
   <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



[GitHub] [flink] JingsongLi merged pull request #12864: [FLINK-18487][table] Datagen and Blackhole factory omits unrecognized properties silently

Posted by GitBox <gi...@apache.org>.
JingsongLi merged pull request #12864:
URL: https://github.com/apache/flink/pull/12864


   


----------------------------------------------------------------
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



[GitHub] [flink] JingsongLi commented on a change in pull request #12864: [FLINK-18487][table] Datagen and Blackhole factory omits unrecognized properties silently

Posted by GitBox <gi...@apache.org>.
JingsongLi commented on a change in pull request #12864:
URL: https://github.com/apache/flink/pull/12864#discussion_r459326556



##########
File path: flink-table/flink-table-api-java-bridge/src/main/java/org/apache/flink/table/factories/DataGenTableSourceFactory.java
##########
@@ -94,128 +97,176 @@ public String factoryIdentifier() {
 
 	@Override
 	public DynamicTableSource createDynamicTableSource(Context context) {
+		createTableFactoryHelper(this, context).validateExcept(FIELDS);

Review comment:
       No necessary.

##########
File path: flink-table/flink-table-api-java-bridge/src/main/java/org/apache/flink/table/factories/DataGenTableSourceFactory.java
##########
@@ -94,128 +97,176 @@ public String factoryIdentifier() {
 
 	@Override
 	public DynamicTableSource createDynamicTableSource(Context context) {
+		createTableFactoryHelper(this, context).validateExcept(FIELDS);

Review comment:
       Yes, No necessary.




----------------------------------------------------------------
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



[GitHub] [flink] flinkbot edited a comment on pull request #12864: [FLINK-18487][table] Datagen and Blackhole factory omits unrecognized properties silently

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12864:
URL: https://github.com/apache/flink/pull/12864#issuecomment-656503840


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "499f80cfa226fe3cf8dbc1edc707e76b01fe1182",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4387",
       "triggerID" : "499f80cfa226fe3cf8dbc1edc707e76b01fe1182",
       "triggerType" : "PUSH"
     }, {
       "hash" : "00dcb531f4342280f1fd56fc89cfb921a11d01f3",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4391",
       "triggerID" : "00dcb531f4342280f1fd56fc89cfb921a11d01f3",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 499f80cfa226fe3cf8dbc1edc707e76b01fe1182 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4387) 
   * 00dcb531f4342280f1fd56fc89cfb921a11d01f3 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4391) 
   
   <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



[GitHub] [flink] flinkbot edited a comment on pull request #12864: [FLINK-18487][table] Datagen and Blackhole factory omits unrecognized properties silently

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12864:
URL: https://github.com/apache/flink/pull/12864#issuecomment-656503840


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "499f80cfa226fe3cf8dbc1edc707e76b01fe1182",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4387",
       "triggerID" : "499f80cfa226fe3cf8dbc1edc707e76b01fe1182",
       "triggerType" : "PUSH"
     }, {
       "hash" : "00dcb531f4342280f1fd56fc89cfb921a11d01f3",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4391",
       "triggerID" : "00dcb531f4342280f1fd56fc89cfb921a11d01f3",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 499f80cfa226fe3cf8dbc1edc707e76b01fe1182 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4387) 
   * 00dcb531f4342280f1fd56fc89cfb921a11d01f3 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4391) 
   
   <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



[GitHub] [flink] flinkbot edited a comment on pull request #12864: [FLINK-18487][table] Datagen and Blackhole factory omits unrecognized properties silently

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12864:
URL: https://github.com/apache/flink/pull/12864#issuecomment-656503840


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "499f80cfa226fe3cf8dbc1edc707e76b01fe1182",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4387",
       "triggerID" : "499f80cfa226fe3cf8dbc1edc707e76b01fe1182",
       "triggerType" : "PUSH"
     }, {
       "hash" : "00dcb531f4342280f1fd56fc89cfb921a11d01f3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4391",
       "triggerID" : "00dcb531f4342280f1fd56fc89cfb921a11d01f3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "dc885404cf1343b8316b8574208a2ed9f862673e",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4625",
       "triggerID" : "dc885404cf1343b8316b8574208a2ed9f862673e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * dc885404cf1343b8316b8574208a2ed9f862673e Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4625) 
   
   <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



[GitHub] [flink] flinkbot edited a comment on pull request #12864: [FLINK-18487][table] Datagen and Blackhole factory omits unrecognized properties silently

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12864:
URL: https://github.com/apache/flink/pull/12864#issuecomment-656503840


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "499f80cfa226fe3cf8dbc1edc707e76b01fe1182",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4387",
       "triggerID" : "499f80cfa226fe3cf8dbc1edc707e76b01fe1182",
       "triggerType" : "PUSH"
     }, {
       "hash" : "00dcb531f4342280f1fd56fc89cfb921a11d01f3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4391",
       "triggerID" : "00dcb531f4342280f1fd56fc89cfb921a11d01f3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "dc885404cf1343b8316b8574208a2ed9f862673e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4625",
       "triggerID" : "dc885404cf1343b8316b8574208a2ed9f862673e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "88f7eacc4536eecfd7149cceab463597682945fb",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4767",
       "triggerID" : "88f7eacc4536eecfd7149cceab463597682945fb",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 88f7eacc4536eecfd7149cceab463597682945fb Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4767) 
   
   <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



[GitHub] [flink] flinkbot edited a comment on pull request #12864: [FLINK-18487][table] Datagen and Blackhole factory omits unrecognized properties silently

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12864:
URL: https://github.com/apache/flink/pull/12864#issuecomment-656503840


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "499f80cfa226fe3cf8dbc1edc707e76b01fe1182",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4387",
       "triggerID" : "499f80cfa226fe3cf8dbc1edc707e76b01fe1182",
       "triggerType" : "PUSH"
     }, {
       "hash" : "00dcb531f4342280f1fd56fc89cfb921a11d01f3",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "00dcb531f4342280f1fd56fc89cfb921a11d01f3",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 499f80cfa226fe3cf8dbc1edc707e76b01fe1182 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4387) 
   * 00dcb531f4342280f1fd56fc89cfb921a11d01f3 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



[GitHub] [flink] flinkbot edited a comment on pull request #12864: [FLINK-18487][table] Datagen and Blackhole factory omits unrecognized properties silently

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12864:
URL: https://github.com/apache/flink/pull/12864#issuecomment-656503840


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "499f80cfa226fe3cf8dbc1edc707e76b01fe1182",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4387",
       "triggerID" : "499f80cfa226fe3cf8dbc1edc707e76b01fe1182",
       "triggerType" : "PUSH"
     }, {
       "hash" : "00dcb531f4342280f1fd56fc89cfb921a11d01f3",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4391",
       "triggerID" : "00dcb531f4342280f1fd56fc89cfb921a11d01f3",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 00dcb531f4342280f1fd56fc89cfb921a11d01f3 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4391) 
   
   <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