@@ -309,17 +309,12 @@ class CodegenContext {
309
309
funcCode : String ,
310
310
inlineToOuterClass : Boolean = false ): String = {
311
311
val newFunction = addNewFunctionInternal(funcName, funcCode, inlineToOuterClass)
312
- qualifiedFunctionName(newFunction)
313
- }
314
-
315
- // Returns the name of the function, qualified by class if it will be inlined to a private,
316
- // inner class
317
- private [this ] def qualifiedFunctionName (functionSpec : NewFunctionSpec ): String =
318
- functionSpec match {
312
+ newFunction match {
319
313
case NewFunctionSpec (functionName, None , None ) => functionName
320
314
case NewFunctionSpec (functionName, Some (_), Some (innerClassInstance)) =>
321
315
innerClassInstance + " ." + functionName
322
316
}
317
+ }
323
318
324
319
private [this ] def addNewFunctionInternal (
325
320
funcName : String ,
@@ -800,19 +795,14 @@ class CodegenContext {
800
795
* @param returnType the return type of the split function.
801
796
* @param makeSplitFunction makes split function body, e.g. add preparation or cleanup.
802
797
* @param foldFunctions folds the split function calls.
803
- * @param makeFunctionCallback a callback function that is called after each function split.
804
- * The name of split function will be passed into the callback.
805
- * @param mergeSplit When true, try to merge split methods.
806
798
*/
807
799
def splitExpressionsWithCurrentInputs (
808
800
expressions : Seq [String ],
809
801
funcName : String = " apply" ,
810
802
extraArguments : Seq [(String , String )] = Nil ,
811
803
returnType : String = " void" ,
812
804
makeSplitFunction : String => String = identity,
813
- foldFunctions : Seq [String ] => String = _.mkString(" " , " ;\n " , " ;" ),
814
- makeFunctionCallback : String => Unit = identity,
815
- mergeSplit : Boolean = true ): String = {
805
+ foldFunctions : Seq [String ] => String = _.mkString(" " , " ;\n " , " ;" )): String = {
816
806
// TODO: support whole stage codegen
817
807
if (INPUT_ROW == null || currentVars != null ) {
818
808
expressions.mkString(" \n " )
@@ -823,9 +813,7 @@ class CodegenContext {
823
813
(" InternalRow" , INPUT_ROW ) +: extraArguments,
824
814
returnType,
825
815
makeSplitFunction,
826
- foldFunctions,
827
- makeFunctionCallback,
828
- mergeSplit)
816
+ foldFunctions)
829
817
}
830
818
}
831
819
@@ -841,19 +829,14 @@ class CodegenContext {
841
829
* @param returnType the return type of the split function.
842
830
* @param makeSplitFunction makes split function body, e.g. add preparation or cleanup.
843
831
* @param foldFunctions folds the split function calls.
844
- * @param makeFunctionCallback a callback function that is called after each function split.
845
- * The name of split function will be passed into the callback.
846
- * @param mergeSplit When true, try to merge split methods.
847
832
*/
848
833
def splitExpressions (
849
834
expressions : Seq [String ],
850
835
funcName : String ,
851
836
arguments : Seq [(String , String )],
852
837
returnType : String = " void" ,
853
838
makeSplitFunction : String => String = identity,
854
- foldFunctions : Seq [String ] => String = _.mkString(" " , " ;\n " , " ;" ),
855
- makeFunctionCallback : String => Unit = identity,
856
- mergeSplit : Boolean = true ): String = {
839
+ foldFunctions : Seq [String ] => String = _.mkString(" " , " ;\n " , " ;" )): String = {
857
840
val blocks = buildCodeBlocks(expressions)
858
841
859
842
if (blocks.length == 1 ) {
@@ -869,9 +852,7 @@ class CodegenContext {
869
852
| ${makeSplitFunction(body)}
870
853
|}
871
854
""" .stripMargin
872
- val functionSpec = addNewFunctionInternal(name, code, inlineToOuterClass = false )
873
- makeFunctionCallback(qualifiedFunctionName(functionSpec))
874
- functionSpec
855
+ addNewFunctionInternal(name, code, inlineToOuterClass = false )
875
856
}
876
857
877
858
val (outerClassFunctions, innerClassFunctions) = functions.partition(_.innerClassName.isEmpty)
@@ -885,8 +866,7 @@ class CodegenContext {
885
866
arguments,
886
867
returnType,
887
868
makeSplitFunction,
888
- foldFunctions,
889
- mergeSplit)
869
+ foldFunctions)
890
870
891
871
foldFunctions(outerClassFunctionCalls ++ innerClassFunctionCalls)
892
872
}
@@ -934,7 +914,6 @@ class CodegenContext {
934
914
* @param returnType the return type of the split function.
935
915
* @param makeSplitFunction makes split function body, e.g. add preparation or cleanup.
936
916
* @param foldFunctions folds the split function calls.
937
- * @param mergeSplit When true, try to merge split methods.
938
917
* @return an [[Iterable ]] containing the methods' invocations
939
918
*/
940
919
private def generateInnerClassesFunctionCalls (
@@ -943,8 +922,7 @@ class CodegenContext {
943
922
arguments : Seq [(String , String )],
944
923
returnType : String ,
945
924
makeSplitFunction : String => String ,
946
- foldFunctions : Seq [String ] => String ,
947
- mergeSplit : Boolean = true ): Iterable [String ] = {
925
+ foldFunctions : Seq [String ] => String ): Iterable [String ] = {
948
926
val innerClassToFunctions = mutable.LinkedHashMap .empty[(String , String ), Seq [String ]]
949
927
functions.foreach(f => {
950
928
val key = (f.innerClassName.get, f.innerClassInstance.get)
@@ -960,7 +938,7 @@ class CodegenContext {
960
938
// for performance reasons, the functions are prepended, instead of appended,
961
939
// thus here they are in reversed order
962
940
val orderedFunctions = innerClassFunctions.reverse
963
- if (mergeSplit && orderedFunctions.size > CodeGenerator .MERGE_SPLIT_METHODS_THRESHOLD ) {
941
+ if (orderedFunctions.size > CodeGenerator .MERGE_SPLIT_METHODS_THRESHOLD ) {
964
942
// Adding a new function to each inner class which contains the invocation of all the
965
943
// ones which have been added to that inner class. For example,
966
944
// private class NestedClass {
0 commit comments