Github user walterddr commented on a diff in the pull request:
https://github.com/apache/flink/pull/5174#discussion_r171358583
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/nodes/CommonCalc.scala
---
@@ -46,10 +47,22 @@ trait CommonCalc {
returnSchema.fieldNames,
calcProjection)
+ val (defines, bodies, callings) = generateCalcSplitFunctions(
+ generator,
+ projection.codeBuffer,
+ config.getMaxGeneratedCodeLength)
+
+ val split = config.getMaxGeneratedCodeLength < projection.code.length
+ val projectionCode = if (split && !projection.codeBuffer.isEmpty) {
--- End diff --
We can probably add this to the `generatedCalcSplitFunctions`, and let it
always return the `samHeader` function (split or not), and with optional
`defines` and `bodies`. This encapsulates all splitting functionality in one
place, what do you think?
---