[ 
https://issues.apache.org/jira/browse/FLINK-20549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rui Li updated FLINK-20549:
---------------------------
    Description: 
When users change session properties from SQL client, {{LocalExecutor}} creates 
a new {{ExecutionContext}}. The new {{ExecutionContext}} inherits 
{{SessionState}} from previous session, which means the loaded Catalog/Module 
instances are reused. Since Catalog/Module are pluggable, the classes may come 
from user jars. However the new {{ExecutionContext}} doesn't inherit 
classloader from previous session. That means when the Catalog/Module instances 
are used, the thread context classloader and the defining classloader are 
different.

This can cause problems such as:
# Define a {{HiveModule}} in yaml file. Don't put the hive connector jar under 
lib folder, but add it through the {{"-l"}} option when launching the SQL 
client.
# Run some query using a hive built-in function.
# Change some session property to trigger a re-creation of {{ExecutionContext}}.
# Run the same query again and it would fail because the hive built-in function 
cannot be instantiated.

> New ExecutionContext doesn't inherit classloader from previous context
> ----------------------------------------------------------------------
>
>                 Key: FLINK-20549
>                 URL: https://issues.apache.org/jira/browse/FLINK-20549
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Client
>            Reporter: Rui Li
>            Priority: Major
>
> When users change session properties from SQL client, {{LocalExecutor}} 
> creates a new {{ExecutionContext}}. The new {{ExecutionContext}} inherits 
> {{SessionState}} from previous session, which means the loaded Catalog/Module 
> instances are reused. Since Catalog/Module are pluggable, the classes may 
> come from user jars. However the new {{ExecutionContext}} doesn't inherit 
> classloader from previous session. That means when the Catalog/Module 
> instances are used, the thread context classloader and the defining 
> classloader are different.
> This can cause problems such as:
> # Define a {{HiveModule}} in yaml file. Don't put the hive connector jar 
> under lib folder, but add it through the {{"-l"}} option when launching the 
> SQL client.
> # Run some query using a hive built-in function.
> # Change some session property to trigger a re-creation of 
> {{ExecutionContext}}.
> # Run the same query again and it would fail because the hive built-in 
> function cannot be instantiated.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to