Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Commit

Permalink
adding new supportcodegen check method
Browse files Browse the repository at this point in the history
Signed-off-by: Yuan Zhou <[email protected]>
  • Loading branch information
zhouyuan committed Aug 5, 2022
1 parent 572d39d commit 5de484f
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,8 @@ object ColumnarDateTimeExpressions {
extends UnixTimestamp(left, right, timeZoneId, failOnError) with
ColumnarExpression {

val gName = "unix_seconds"

val yearMonthDayFormat = "yyyy-MM-dd"
val yearMonthDayTimeFormat = "yyyy-MM-dd HH:mm:ss"
val yearMonthDayTimeNoSepFormat = "yyyyMMddHHmmss"
Expand Down Expand Up @@ -486,7 +488,8 @@ object ColumnarDateTimeExpressions {
}

override def supportColumnarCodegen(args: Object): Boolean = {
false && left.asInstanceOf[ColumnarExpression].supportColumnarCodegen(args) &&
codegenFuncList.contains(gName) &&
left.asInstanceOf[ColumnarExpression].supportColumnarCodegen(args) &&
right.asInstanceOf[ColumnarExpression].supportColumnarCodegen(args)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,67 @@ import scala.collection.mutable.ListBuffer

trait ColumnarExpression {

val codegenFuncList: List[String] = List(
"less_than",
"less_than_with_nan",
"greater_than",
"greater_than_with_nan",
"less_than_or_equal_to",
"less_than_or_equal_to_with_nan",
"greater_than_or_equal_to",
"greater_than_or_equal_to_with_nan",
"equal",
"equal_with_nan",
"not",
"isnotnull",
"isnull",
"starts_with",
"like",
"get_json_object",
"translate",
"substr",
"instr",
"btrim",
"ltrim",
"rtrim",
"upper",
"lower",
"castDATE",
"castDECIMAL",
"castDECIMALNullOnOverflow",
"castINTOrNull",
"castBIGINTOrNull",
"castFLOAT4OrNull",
"castFLOAT8OrNull",
"castDATE",
"castDECIMAL",
"castDECIMALNullOnOverflow",
"castINTOrNull",
"castBIGINTOrNull",
"castFLOAT4OrNull",
"castFLOAT8OrNull",
"castINTOrNull",
"castBIGINTOrNull",
"castFLOAT4OrNull",
"rescaleDECIMAL",
"extractYear",
"round",
"abs",
"add",
"subtract",
"multiply",
"divide",
"shift_left",
"shift_right",
"bitwise_and",
"bitwise_or",
"normalize",
"convertTimestampUnit",
"micros_to_timestamp"
)

def supportColumnarCodegen(args: java.lang.Object): (Boolean) = {
// TODO: disable all codegen unless manuall enabled
true
false
}

def doColumnarCodeGen(args: java.lang.Object): (TreeNode, ArrowType) = {
Expand Down

0 comments on commit 5de484f

Please sign in to comment.