Skip to content

Commit

Permalink
[FLINK-7490] [table] Use correct classloader to compile generated cod…
Browse files Browse the repository at this point in the history
…e that calls UDAGGs.

This closes apache#5018.
  • Loading branch information
fhueske authored and twalthr committed Nov 15, 2017
1 parent 54eeccf commit 59df4b7
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public RichCombineToGroupCombineWrapper(F wrappedFunction) {

@Override
public void open(Configuration config) throws Exception {
wrappedFunction.setRuntimeContext(getRuntimeContext());
wrappedFunction.open(config);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class AggregateAggFunction(genAggregations: GeneratedAggregationsFunction)
LOG.debug(s"Compiling AggregateHelper: $genAggregations.name \n\n " +
s"Code:\n$genAggregations.code")
val clazz = compile(
getClass.getClassLoader,
Thread.currentThread().getContextClassLoader,
genAggregations.name,
genAggregations.code)
LOG.debug("Instantiating AggregateHelper.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class DataSetAggFunction(
LOG.debug(s"Compiling AggregateHelper: $genAggregations.name \n\n " +
s"Code:\n$genAggregations.code")
val clazz = compile(
getClass.getClassLoader,
getRuntimeContext.getUserCodeClassLoader,
genAggregations.name,
genAggregations.code)
LOG.debug("Instantiating AggregateHelper.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class DataSetFinalAggFunction(
LOG.debug(s"Compiling AggregateHelper: $genAggregations.name \n\n " +
s"Code:\n$genAggregations.code")
val clazz = compile(
getClass.getClassLoader,
getRuntimeContext.getUserCodeClassLoader,
genAggregations.name,
genAggregations.code)
LOG.debug("Instantiating AggregateHelper.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class DataSetPreAggFunction(genAggregations: GeneratedAggregationsFunction)
LOG.debug(s"Compiling AggregateHelper: $genAggregations.name \n\n " +
s"Code:\n$genAggregations.code")
val clazz = compile(
getClass.getClassLoader,
getRuntimeContext.getUserCodeClassLoader,
genAggregations.name,
genAggregations.code)
LOG.debug("Instantiating AggregateHelper.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class DataSetSessionWindowAggReduceGroupFunction(
LOG.debug(s"Compiling AggregateHelper: $genAggregations.name \n\n " +
s"Code:\n$genAggregations.code")
val clazz = compile(
getClass.getClassLoader,
getRuntimeContext.getUserCodeClassLoader,
genAggregations.name,
genAggregations.code)
LOG.debug("Instantiating AggregateHelper.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class DataSetSessionWindowAggregatePreProcessor(
LOG.debug(s"Compiling AggregateHelper: $genAggregations.name \n\n " +
s"Code:\n$genAggregations.code")
val clazz = compile(
getClass.getClassLoader,
getRuntimeContext.getUserCodeClassLoader,
genAggregations.name,
genAggregations.code)
LOG.debug("Instantiating AggregateHelper.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class DataSetSlideTimeWindowAggReduceGroupFunction(
LOG.debug(s"Compiling AggregateHelper: $genAggregations.name \n\n " +
s"Code:\n$genAggregations.code")
val clazz = compile(
getClass.getClassLoader,
getRuntimeContext.getUserCodeClassLoader,
genAggregations.name,
genAggregations.code)
LOG.debug("Instantiating AggregateHelper.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class DataSetSlideWindowAggReduceCombineFunction(
LOG.debug(s"Compiling AggregateHelper: $genPreAggregations.name \n\n " +
s"Code:\n$genPreAggregations.code")
val clazz = compile(
getClass.getClassLoader,
getRuntimeContext.getUserCodeClassLoader,
genPreAggregations.name,
genPreAggregations.code)
LOG.debug("Instantiating AggregateHelper.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class DataSetSlideWindowAggReduceGroupFunction(
LOG.debug(s"Compiling AggregateHelper: $genAggregations.name \n\n " +
s"Code:\n$genAggregations.code")
val clazz = compile(
getClass.getClassLoader,
getRuntimeContext.getUserCodeClassLoader,
genAggregations.name,
genAggregations.code)
LOG.debug("Instantiating AggregateHelper.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class DataSetTumbleCountWindowAggReduceGroupFunction(
LOG.debug(s"Compiling AggregateHelper: $genAggregations.name \n\n " +
s"Code:\n$genAggregations.code")
val clazz = compile(
getClass.getClassLoader,
getRuntimeContext.getUserCodeClassLoader,
genAggregations.name,
genAggregations.code)
LOG.debug("Instantiating AggregateHelper.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class DataSetTumbleTimeWindowAggReduceCombineFunction(
LOG.debug(s"Compiling AggregateHelper: $genPreAggregations.name \n\n " +
s"Code:\n$genPreAggregations.code")
val clazz = compile(
getClass.getClassLoader,
getRuntimeContext.getUserCodeClassLoader,
genPreAggregations.name,
genPreAggregations.code)
LOG.debug("Instantiating AggregateHelper.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class DataSetTumbleTimeWindowAggReduceGroupFunction(
LOG.debug(s"Compiling AggregateHelper: $genAggregations.name \n\n " +
s"Code:\n$genAggregations.code")
val clazz = compile(
getClass.getClassLoader,
getRuntimeContext.getUserCodeClassLoader,
genAggregations.name,
genAggregations.code)
LOG.debug("Instantiating AggregateHelper.")
Expand Down

0 comments on commit 59df4b7

Please sign in to comment.