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/17 06:19:01 UTC

[GitHub] [flink] JingsongLi opened a new pull request #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath

JingsongLi opened a new pull request #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath
URL: https://github.com/apache/flink/pull/10878
 
 
   
   ## What is the purpose of the change
   
   Sql client uses directly some of the internal classes of the legacy planner, thus it does not work with only the blink planner on the classpath.
   The internal class that's being used is org.apache.flink.table.functions.FunctionService
   This dependency was introduced in FLINK-13195
   
   ## Brief change log
   
   - Port FunctionService and FunctionServiceTest to table-common
   - check explicitly for an instance of Blink's executor by PlannerFactory
   
   ## Verifying this change
   
   Manual testing
   
   ## 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, 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


With regards,
Apache Git Services

[GitHub] [flink] dawidwys commented on a change in pull request #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath

Posted by GitBox <gi...@apache.org>.
dawidwys commented on a change in pull request #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath
URL: https://github.com/apache/flink/pull/10878#discussion_r368004811
 
 

 ##########
 File path: flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/ExecutionContext.java
 ##########
 @@ -269,12 +272,11 @@ public Pipeline createPipeline(String name, Configuration flinkConfig) {
 		if (streamExecEnv != null) {
 			// special case for Blink planner to apply batch optimizations
 			// note: it also modifies the ExecutionConfig!
-			if (executor instanceof ExecutorBase) {
+			if (isBlinkPlanner) {
 
 Review comment:
   I am not sure if I would go for that solution. I don't necessarily like the way we set this property. It also complicates the instantiation logic and couples it very tightly with the internal structure.
   
   How about we perform the check in a following manner:
   ```
   if (isBlinkPlanner(executor.getClass)) {
   ...
   }
   ...
   
   public boolean isBlinkPlanner(Class<? extends Executor> executorClass) {
      try {
          return ExecutorBase.class.isAssignableFrom(executorClass);
      } catch (NoClassDefFound ex) {
          // blink planner might not be on the class path
          return false;
      }
   }
   ```

----------------------------------------------------------------
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 #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath

Posted by GitBox <gi...@apache.org>.
dawidwys commented on issue #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath
URL: https://github.com/apache/flink/pull/10878#issuecomment-576141182
 
 
   LGTM, will merge once the build is green
   
   @flinkbot run azure
   @flinkbot run travis

----------------------------------------------------------------
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 #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath

Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath
URL: https://github.com/apache/flink/pull/10878#issuecomment-575482343
 
 
   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 d7aafde7cefee21e4b332517654c96171bdf48ef (Fri Jan 17 06:21:25 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] dawidwys commented on a change in pull request #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath

Posted by GitBox <gi...@apache.org>.
dawidwys commented on a change in pull request #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath
URL: https://github.com/apache/flink/pull/10878#discussion_r368012192
 
 

 ##########
 File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/FunctionService.java
 ##########
 @@ -0,0 +1,184 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.functions;
+
+import org.apache.flink.api.java.tuple.Tuple2;
+import org.apache.flink.table.api.ValidationException;
+import org.apache.flink.table.descriptors.ClassInstanceValidator;
+import org.apache.flink.table.descriptors.DescriptorProperties;
+import org.apache.flink.table.descriptors.FunctionDescriptor;
+import org.apache.flink.table.descriptors.FunctionDescriptorValidator;
+import org.apache.flink.table.descriptors.HierarchyDescriptorValidator;
+import org.apache.flink.table.descriptors.LiteralValueValidator;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.lang.reflect.Constructor;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Service for creating configured instances of {@link UserDefinedFunction} using a
+ * {@link FunctionDescriptor}.
+ */
+public class FunctionService {
+
+	private static final Logger LOG = LoggerFactory.getLogger(FunctionService.class);
+
+	/**
+	 * Creates a user-defined function with the given properties and the current thread's
+	 * context class loader.
+	 *
+	 * @param descriptor the descriptor that describes a function
+	 * @return the generated user-defined function
+	 */
+	public static UserDefinedFunction createFunction(FunctionDescriptor descriptor) {
+		return createFunction(descriptor, Thread.currentThread().getContextClassLoader());
+	}
+
+	/**
+	 * Creates a user-defined function with the given properties.
+	 *
+	 * @param descriptor the descriptor that describes a function
+	 * @param classLoader the class loader to load the function and its parameter's classes
+	 * @return the generated user-defined function
+	 */
+	public static UserDefinedFunction createFunction(
+			FunctionDescriptor descriptor,
+			ClassLoader classLoader) {
+		return createFunction(descriptor, classLoader, true);
+	}
+
+	/**
+	 * Creates a user-defined function with the given properties.
+	 *
+	 * @param descriptor the descriptor that describes a function
+	 * @param classLoader the class loader to load the function and its parameter's classes
+	 * @param performValidation whether or not the descriptor should be validated
+	 * @return the generated user-defined function
+	 */
+	public static UserDefinedFunction createFunction(
+			FunctionDescriptor descriptor,
+			ClassLoader classLoader,
+			boolean performValidation) {
+
+		DescriptorProperties properties = new DescriptorProperties(true);
+		properties.putProperties(descriptor.toProperties());
+
+		// validate
+		if (performValidation) {
+			new FunctionDescriptorValidator().validate(properties);
+		}
+
+		// instantiate
+		Tuple2<Class<Object>, Object> tuple2 = generateInstance(
+				HierarchyDescriptorValidator.EMPTY_PREFIX,
+				properties,
+				classLoader);
+
+		if (!UserDefinedFunction.class.isAssignableFrom(tuple2.f0)) {
+			throw new ValidationException(
+					String.format("Instantiated class '%s' is not a user-defined function.", tuple2.f0.getName()));
+		}
+		return (UserDefinedFunction) tuple2.f1;
+	}
+
+	/**
+	 * Recursively generate an instance of a class according the given properties.
+	 *
+	 * @param keyPrefix the prefix to fetch properties
+	 * @param descriptorProperties the descriptor properties that contains the class type information
+	 * @param classLoader the class loader to load the class
+	 * @param <T> type fo the generated instance
+	 * @return an instance of the class
+	 */
+	private static <T> Tuple2<Class<T>, T> generateInstance(
 
 Review comment:
   Do we need to return the class separately? Can't we just call the `.getClass` on the instance whenever necessary?
   
   If it is necessary can we at least have a specialized pojo for that rather than returning a Pojo? But I really believer we can just return the instance.

----------------------------------------------------------------
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 #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath
URL: https://github.com/apache/flink/pull/10878#issuecomment-575493814
 
 
   <!--
   Meta data
   Hash:6ce81e21780883796248af5c87d2ec5f1dc5e0ef Status:UNKNOWN URL:TBD TriggerType:PUSH TriggerID:6ce81e21780883796248af5c87d2ec5f1dc5e0ef
   Hash:47ab573d50ed82018632ed1106b9deb79e83d820 Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4419 TriggerType:PUSH TriggerID:47ab573d50ed82018632ed1106b9deb79e83d820
   Hash:47ab573d50ed82018632ed1106b9deb79e83d820 Status:SUCCESS URL:https://travis-ci.com/flink-ci/flink/builds/144866957 TriggerType:PUSH TriggerID:47ab573d50ed82018632ed1106b9deb79e83d820
   Hash:82ad91185396e2ff3b6be078e7e933d0acbfabe4 Status:FAILURE URL:https://travis-ci.com/flink-ci/flink/builds/145097683 TriggerType:PUSH TriggerID:82ad91185396e2ff3b6be078e7e933d0acbfabe4
   Hash:82ad91185396e2ff3b6be078e7e933d0acbfabe4 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4464 TriggerType:PUSH TriggerID:82ad91185396e2ff3b6be078e7e933d0acbfabe4
   Hash:82ad91185396e2ff3b6be078e7e933d0acbfabe4 Status:PENDING URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4464 TriggerType:MANUAL TriggerID:576141182
   Hash:59b0a46db122f3afa25b69a2f93301c2cd878538 Status:UNKNOWN URL:TBD TriggerType:PUSH TriggerID:59b0a46db122f3afa25b69a2f93301c2cd878538
   -->
   ## CI report:
   
   * 6ce81e21780883796248af5c87d2ec5f1dc5e0ef UNKNOWN
   * 47ab573d50ed82018632ed1106b9deb79e83d820 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/144866957) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4419) 
   * 82ad91185396e2ff3b6be078e7e933d0acbfabe4 Travis: [FAILURE](https://travis-ci.com/flink-ci/flink/builds/145097683) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4464) 
   * 59b0a46db122f3afa25b69a2f93301c2cd878538 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

[GitHub] [flink] flinkbot edited a comment on issue #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath
URL: https://github.com/apache/flink/pull/10878#issuecomment-575493814
 
 
   <!--
   Meta data
   Hash:6ce81e21780883796248af5c87d2ec5f1dc5e0ef Status:UNKNOWN URL:TBD TriggerType:PUSH TriggerID:6ce81e21780883796248af5c87d2ec5f1dc5e0ef
   Hash:47ab573d50ed82018632ed1106b9deb79e83d820 Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4419 TriggerType:PUSH TriggerID:47ab573d50ed82018632ed1106b9deb79e83d820
   Hash:47ab573d50ed82018632ed1106b9deb79e83d820 Status:SUCCESS URL:https://travis-ci.com/flink-ci/flink/builds/144866957 TriggerType:PUSH TriggerID:47ab573d50ed82018632ed1106b9deb79e83d820
   -->
   ## CI report:
   
   * 6ce81e21780883796248af5c87d2ec5f1dc5e0ef UNKNOWN
   * 47ab573d50ed82018632ed1106b9deb79e83d820 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/144866957) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4419) 
   
   <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] flinkbot edited a comment on issue #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath
URL: https://github.com/apache/flink/pull/10878#issuecomment-575493814
 
 
   <!--
   Meta data
   Hash:6ce81e21780883796248af5c87d2ec5f1dc5e0ef Status:UNKNOWN URL:TBD TriggerType:PUSH TriggerID:6ce81e21780883796248af5c87d2ec5f1dc5e0ef
   Hash:47ab573d50ed82018632ed1106b9deb79e83d820 Status:UNKNOWN URL:TBD TriggerType:PUSH TriggerID:47ab573d50ed82018632ed1106b9deb79e83d820
   -->
   ## CI report:
   
   * 6ce81e21780883796248af5c87d2ec5f1dc5e0ef UNKNOWN
   * 47ab573d50ed82018632ed1106b9deb79e83d820 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

[GitHub] [flink] JingsongLi commented on a change in pull request #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath

Posted by GitBox <gi...@apache.org>.
JingsongLi commented on a change in pull request #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath
URL: https://github.com/apache/flink/pull/10878#discussion_r368268653
 
 

 ##########
 File path: flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/ExecutionContext.java
 ##########
 @@ -269,12 +272,11 @@ public Pipeline createPipeline(String name, Configuration flinkConfig) {
 		if (streamExecEnv != null) {
 			// special case for Blink planner to apply batch optimizations
 			// note: it also modifies the ExecutionConfig!
-			if (executor instanceof ExecutorBase) {
+			if (isBlinkPlanner) {
 
 Review comment:
   Good point! Catch `NoClassDefFoundError` looks very good to me.
   I've been struggling with this for a long time.

----------------------------------------------------------------
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 #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath
URL: https://github.com/apache/flink/pull/10878#issuecomment-575493814
 
 
   <!--
   Meta data
   Hash:6ce81e21780883796248af5c87d2ec5f1dc5e0ef Status:UNKNOWN URL:TBD TriggerType:PUSH TriggerID:6ce81e21780883796248af5c87d2ec5f1dc5e0ef
   Hash:47ab573d50ed82018632ed1106b9deb79e83d820 Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4419 TriggerType:PUSH TriggerID:47ab573d50ed82018632ed1106b9deb79e83d820
   Hash:47ab573d50ed82018632ed1106b9deb79e83d820 Status:SUCCESS URL:https://travis-ci.com/flink-ci/flink/builds/144866957 TriggerType:PUSH TriggerID:47ab573d50ed82018632ed1106b9deb79e83d820
   Hash:82ad91185396e2ff3b6be078e7e933d0acbfabe4 Status:FAILURE URL:https://travis-ci.com/flink-ci/flink/builds/145097683 TriggerType:PUSH TriggerID:82ad91185396e2ff3b6be078e7e933d0acbfabe4
   Hash:82ad91185396e2ff3b6be078e7e933d0acbfabe4 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4464 TriggerType:PUSH TriggerID:82ad91185396e2ff3b6be078e7e933d0acbfabe4
   -->
   ## CI report:
   
   * 6ce81e21780883796248af5c87d2ec5f1dc5e0ef UNKNOWN
   * 47ab573d50ed82018632ed1106b9deb79e83d820 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/144866957) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4419) 
   * 82ad91185396e2ff3b6be078e7e933d0acbfabe4 Travis: [FAILURE](https://travis-ci.com/flink-ci/flink/builds/145097683) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4464) 
   
   <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] flinkbot edited a comment on issue #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath
URL: https://github.com/apache/flink/pull/10878#issuecomment-575493814
 
 
   <!--
   Meta data
   Hash:6ce81e21780883796248af5c87d2ec5f1dc5e0ef Status:UNKNOWN URL:TBD TriggerType:PUSH TriggerID:6ce81e21780883796248af5c87d2ec5f1dc5e0ef
   Hash:47ab573d50ed82018632ed1106b9deb79e83d820 Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4419 TriggerType:PUSH TriggerID:47ab573d50ed82018632ed1106b9deb79e83d820
   Hash:47ab573d50ed82018632ed1106b9deb79e83d820 Status:SUCCESS URL:https://travis-ci.com/flink-ci/flink/builds/144866957 TriggerType:PUSH TriggerID:47ab573d50ed82018632ed1106b9deb79e83d820
   Hash:82ad91185396e2ff3b6be078e7e933d0acbfabe4 Status:PENDING URL:https://travis-ci.com/flink-ci/flink/builds/145097683 TriggerType:PUSH TriggerID:82ad91185396e2ff3b6be078e7e933d0acbfabe4
   Hash:82ad91185396e2ff3b6be078e7e933d0acbfabe4 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4464 TriggerType:PUSH TriggerID:82ad91185396e2ff3b6be078e7e933d0acbfabe4
   -->
   ## CI report:
   
   * 6ce81e21780883796248af5c87d2ec5f1dc5e0ef UNKNOWN
   * 47ab573d50ed82018632ed1106b9deb79e83d820 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/144866957) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4419) 
   * 82ad91185396e2ff3b6be078e7e933d0acbfabe4 Travis: [PENDING](https://travis-ci.com/flink-ci/flink/builds/145097683) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4464) 
   
   <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] flinkbot edited a comment on issue #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath
URL: https://github.com/apache/flink/pull/10878#issuecomment-575493814
 
 
   <!--
   Meta data
   Hash:6ce81e21780883796248af5c87d2ec5f1dc5e0ef Status:UNKNOWN URL:TBD TriggerType:PUSH TriggerID:6ce81e21780883796248af5c87d2ec5f1dc5e0ef
   Hash:47ab573d50ed82018632ed1106b9deb79e83d820 Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4419 TriggerType:PUSH TriggerID:47ab573d50ed82018632ed1106b9deb79e83d820
   Hash:47ab573d50ed82018632ed1106b9deb79e83d820 Status:SUCCESS URL:https://travis-ci.com/flink-ci/flink/builds/144866957 TriggerType:PUSH TriggerID:47ab573d50ed82018632ed1106b9deb79e83d820
   Hash:82ad91185396e2ff3b6be078e7e933d0acbfabe4 Status:UNKNOWN URL:TBD TriggerType:PUSH TriggerID:82ad91185396e2ff3b6be078e7e933d0acbfabe4
   -->
   ## CI report:
   
   * 6ce81e21780883796248af5c87d2ec5f1dc5e0ef UNKNOWN
   * 47ab573d50ed82018632ed1106b9deb79e83d820 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/144866957) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4419) 
   * 82ad91185396e2ff3b6be078e7e933d0acbfabe4 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

[GitHub] [flink] flinkbot edited a comment on issue #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath
URL: https://github.com/apache/flink/pull/10878#issuecomment-575493814
 
 
   <!--
   Meta data
   Hash:6ce81e21780883796248af5c87d2ec5f1dc5e0ef Status:UNKNOWN URL:TBD TriggerType:PUSH TriggerID:6ce81e21780883796248af5c87d2ec5f1dc5e0ef
   Hash:47ab573d50ed82018632ed1106b9deb79e83d820 Status:PENDING URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4419 TriggerType:PUSH TriggerID:47ab573d50ed82018632ed1106b9deb79e83d820
   Hash:47ab573d50ed82018632ed1106b9deb79e83d820 Status:PENDING URL:https://travis-ci.com/flink-ci/flink/builds/144866957 TriggerType:PUSH TriggerID:47ab573d50ed82018632ed1106b9deb79e83d820
   -->
   ## CI report:
   
   * 6ce81e21780883796248af5c87d2ec5f1dc5e0ef UNKNOWN
   * 47ab573d50ed82018632ed1106b9deb79e83d820 Travis: [PENDING](https://travis-ci.com/flink-ci/flink/builds/144866957) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4419) 
   
   <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] flinkbot edited a comment on issue #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath
URL: https://github.com/apache/flink/pull/10878#issuecomment-575493814
 
 
   <!--
   Meta data
   Hash:6ce81e21780883796248af5c87d2ec5f1dc5e0ef Status:UNKNOWN URL:TBD TriggerType:PUSH TriggerID:6ce81e21780883796248af5c87d2ec5f1dc5e0ef
   Hash:47ab573d50ed82018632ed1106b9deb79e83d820 Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4419 TriggerType:PUSH TriggerID:47ab573d50ed82018632ed1106b9deb79e83d820
   Hash:47ab573d50ed82018632ed1106b9deb79e83d820 Status:SUCCESS URL:https://travis-ci.com/flink-ci/flink/builds/144866957 TriggerType:PUSH TriggerID:47ab573d50ed82018632ed1106b9deb79e83d820
   Hash:82ad91185396e2ff3b6be078e7e933d0acbfabe4 Status:FAILURE URL:https://travis-ci.com/flink-ci/flink/builds/145097683 TriggerType:PUSH TriggerID:82ad91185396e2ff3b6be078e7e933d0acbfabe4
   Hash:82ad91185396e2ff3b6be078e7e933d0acbfabe4 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4464 TriggerType:PUSH TriggerID:82ad91185396e2ff3b6be078e7e933d0acbfabe4
   Hash:82ad91185396e2ff3b6be078e7e933d0acbfabe4 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4464 TriggerType:MANUAL TriggerID:576141182
   Hash:82ad91185396e2ff3b6be078e7e933d0acbfabe4 Status:FAILURE URL:https://travis-ci.com/flink-ci/flink/builds/145097683 TriggerType:MANUAL TriggerID:576141182
   Hash:59b0a46db122f3afa25b69a2f93301c2cd878538 Status:PENDING URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4499 TriggerType:PUSH TriggerID:59b0a46db122f3afa25b69a2f93301c2cd878538
   Hash:59b0a46db122f3afa25b69a2f93301c2cd878538 Status:PENDING URL:https://travis-ci.com/flink-ci/flink/builds/145170987 TriggerType:PUSH TriggerID:59b0a46db122f3afa25b69a2f93301c2cd878538
   -->
   ## CI report:
   
   * 6ce81e21780883796248af5c87d2ec5f1dc5e0ef UNKNOWN
   * 47ab573d50ed82018632ed1106b9deb79e83d820 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/144866957) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4419) 
   * 82ad91185396e2ff3b6be078e7e933d0acbfabe4 Travis: [FAILURE](https://travis-ci.com/flink-ci/flink/builds/145097683) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4464) 
   * 59b0a46db122f3afa25b69a2f93301c2cd878538 Travis: [PENDING](https://travis-ci.com/flink-ci/flink/builds/145170987) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4499) 
   
   <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] dawidwys closed pull request #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath

Posted by GitBox <gi...@apache.org>.
dawidwys closed pull request #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath
URL: https://github.com/apache/flink/pull/10878
 
 
   

----------------------------------------------------------------
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 #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath

Posted by GitBox <gi...@apache.org>.
JingsongLi commented on a change in pull request #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath
URL: https://github.com/apache/flink/pull/10878#discussion_r368268966
 
 

 ##########
 File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/FunctionService.java
 ##########
 @@ -0,0 +1,184 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.functions;
+
+import org.apache.flink.api.java.tuple.Tuple2;
+import org.apache.flink.table.api.ValidationException;
+import org.apache.flink.table.descriptors.ClassInstanceValidator;
+import org.apache.flink.table.descriptors.DescriptorProperties;
+import org.apache.flink.table.descriptors.FunctionDescriptor;
+import org.apache.flink.table.descriptors.FunctionDescriptorValidator;
+import org.apache.flink.table.descriptors.HierarchyDescriptorValidator;
+import org.apache.flink.table.descriptors.LiteralValueValidator;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.lang.reflect.Constructor;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Service for creating configured instances of {@link UserDefinedFunction} using a
+ * {@link FunctionDescriptor}.
+ */
+public class FunctionService {
+
+	private static final Logger LOG = LoggerFactory.getLogger(FunctionService.class);
+
+	/**
+	 * Creates a user-defined function with the given properties and the current thread's
+	 * context class loader.
+	 *
+	 * @param descriptor the descriptor that describes a function
+	 * @return the generated user-defined function
+	 */
+	public static UserDefinedFunction createFunction(FunctionDescriptor descriptor) {
+		return createFunction(descriptor, Thread.currentThread().getContextClassLoader());
+	}
+
+	/**
+	 * Creates a user-defined function with the given properties.
+	 *
+	 * @param descriptor the descriptor that describes a function
+	 * @param classLoader the class loader to load the function and its parameter's classes
+	 * @return the generated user-defined function
+	 */
+	public static UserDefinedFunction createFunction(
+			FunctionDescriptor descriptor,
+			ClassLoader classLoader) {
+		return createFunction(descriptor, classLoader, true);
+	}
+
+	/**
+	 * Creates a user-defined function with the given properties.
+	 *
+	 * @param descriptor the descriptor that describes a function
+	 * @param classLoader the class loader to load the function and its parameter's classes
+	 * @param performValidation whether or not the descriptor should be validated
+	 * @return the generated user-defined function
+	 */
+	public static UserDefinedFunction createFunction(
+			FunctionDescriptor descriptor,
+			ClassLoader classLoader,
+			boolean performValidation) {
+
+		DescriptorProperties properties = new DescriptorProperties(true);
+		properties.putProperties(descriptor.toProperties());
+
+		// validate
+		if (performValidation) {
+			new FunctionDescriptorValidator().validate(properties);
+		}
+
+		// instantiate
+		Tuple2<Class<Object>, Object> tuple2 = generateInstance(
+				HierarchyDescriptorValidator.EMPTY_PREFIX,
+				properties,
+				classLoader);
+
+		if (!UserDefinedFunction.class.isAssignableFrom(tuple2.f0)) {
+			throw new ValidationException(
+					String.format("Instantiated class '%s' is not a user-defined function.", tuple2.f0.getName()));
+		}
+		return (UserDefinedFunction) tuple2.f1;
+	}
+
+	/**
+	 * Recursively generate an instance of a class according the given properties.
+	 *
+	 * @param keyPrefix the prefix to fetch properties
+	 * @param descriptorProperties the descriptor properties that contains the class type information
+	 * @param classLoader the class loader to load the class
+	 * @param <T> type fo the generated instance
+	 * @return an instance of the class
+	 */
+	private static <T> Tuple2<Class<T>, T> generateInstance(
 
 Review comment:
   I think you are right. Sometimes we need another class field to deal with null and parent class. But here, looks like class must equal to `.getClass()`.

----------------------------------------------------------------
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 #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath

Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath
URL: https://github.com/apache/flink/pull/10878#issuecomment-575493814
 
 
   <!--
   Meta data
   Hash:6ce81e21780883796248af5c87d2ec5f1dc5e0ef Status:UNKNOWN URL:TBD TriggerType:PUSH TriggerID:6ce81e21780883796248af5c87d2ec5f1dc5e0ef
   -->
   ## CI report:
   
   * 6ce81e21780883796248af5c87d2ec5f1dc5e0ef 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

[GitHub] [flink] flinkbot edited a comment on issue #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10878: [FLINK-15599][table] SQL client requires both legacy and blink planner to be on the classpath
URL: https://github.com/apache/flink/pull/10878#issuecomment-575493814
 
 
   <!--
   Meta data
   Hash:6ce81e21780883796248af5c87d2ec5f1dc5e0ef Status:UNKNOWN URL:TBD TriggerType:PUSH TriggerID:6ce81e21780883796248af5c87d2ec5f1dc5e0ef
   Hash:47ab573d50ed82018632ed1106b9deb79e83d820 Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4419 TriggerType:PUSH TriggerID:47ab573d50ed82018632ed1106b9deb79e83d820
   Hash:47ab573d50ed82018632ed1106b9deb79e83d820 Status:SUCCESS URL:https://travis-ci.com/flink-ci/flink/builds/144866957 TriggerType:PUSH TriggerID:47ab573d50ed82018632ed1106b9deb79e83d820
   Hash:82ad91185396e2ff3b6be078e7e933d0acbfabe4 Status:FAILURE URL:https://travis-ci.com/flink-ci/flink/builds/145097683 TriggerType:PUSH TriggerID:82ad91185396e2ff3b6be078e7e933d0acbfabe4
   Hash:82ad91185396e2ff3b6be078e7e933d0acbfabe4 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4464 TriggerType:PUSH TriggerID:82ad91185396e2ff3b6be078e7e933d0acbfabe4
   Hash:82ad91185396e2ff3b6be078e7e933d0acbfabe4 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4464 TriggerType:MANUAL TriggerID:576141182
   Hash:82ad91185396e2ff3b6be078e7e933d0acbfabe4 Status:FAILURE URL:https://travis-ci.com/flink-ci/flink/builds/145097683 TriggerType:MANUAL TriggerID:576141182
   Hash:59b0a46db122f3afa25b69a2f93301c2cd878538 Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4499 TriggerType:PUSH TriggerID:59b0a46db122f3afa25b69a2f93301c2cd878538
   Hash:59b0a46db122f3afa25b69a2f93301c2cd878538 Status:FAILURE URL:https://travis-ci.com/flink-ci/flink/builds/145170987 TriggerType:PUSH TriggerID:59b0a46db122f3afa25b69a2f93301c2cd878538
   -->
   ## CI report:
   
   * 6ce81e21780883796248af5c87d2ec5f1dc5e0ef UNKNOWN
   * 47ab573d50ed82018632ed1106b9deb79e83d820 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/144866957) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4419) 
   * 82ad91185396e2ff3b6be078e7e933d0acbfabe4 Travis: [FAILURE](https://travis-ci.com/flink-ci/flink/builds/145097683) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4464) 
   * 59b0a46db122f3afa25b69a2f93301c2cd878538 Travis: [FAILURE](https://travis-ci.com/flink-ci/flink/builds/145170987) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4499) 
   
   <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