From f63de9d7dd4010cf319988efa2ca243c688ddb8b Mon Sep 17 00:00:00 2001 From: philo Date: Mon, 13 Jun 2022 23:28:08 +0800 Subject: [PATCH 1/3] Initial commit --- .../oap/expression/ColumnarUnaryOperator.scala | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/native-sql-engine/core/src/main/scala/com/intel/oap/expression/ColumnarUnaryOperator.scala b/native-sql-engine/core/src/main/scala/com/intel/oap/expression/ColumnarUnaryOperator.scala index 1e3368b79..812f36de5 100644 --- a/native-sql-engine/core/src/main/scala/com/intel/oap/expression/ColumnarUnaryOperator.scala +++ b/native-sql-engine/core/src/main/scala/com/intel/oap/expression/ColumnarUnaryOperator.scala @@ -923,6 +923,22 @@ class ColumnarLength(child: Expression) extends Length(child: Expression) } } +class ColumnarHex(child: Expression) extends Hex(child: Expression) + with ColumnarExpression with Logging { + + override def supportColumnarCodegen(args: java.lang.Object): Boolean = { + false + } + + override def doColumnarCodeGen(args: java.lang.Object): (TreeNode, ArrowType) = { + val (child_node, _): (TreeNode, ArrowType) = + child.asInstanceOf[ColumnarExpression].doColumnarCodeGen(args) + val resultType = new ArrowType.Utf8() + (TreeBuilder.makeFunction("hex", Lists.newArrayList(child_node), + resultType), resultType) + } +} + object ColumnarUnaryOperator { def create(child: Expression, original: Expression): Expression = original match { @@ -992,6 +1008,8 @@ object ColumnarUnaryOperator { new ColumnarRand(child) case len: Length => new ColumnarLength(child) + case hex: Hex => + new ColumnarHex(child) case other => child.dataType match { case _: DateType => other match { From ad742614b0af47c7fe7769daf00e24a3588e57c9 Mon Sep 17 00:00:00 2001 From: philo Date: Tue, 14 Jun 2022 17:31:13 +0800 Subject: [PATCH 2/3] Change arrow branch [will revert at last] --- arrow-data-source/script/build_arrow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arrow-data-source/script/build_arrow.sh b/arrow-data-source/script/build_arrow.sh index d8ec40128..d055d5cc9 100755 --- a/arrow-data-source/script/build_arrow.sh +++ b/arrow-data-source/script/build_arrow.sh @@ -62,7 +62,7 @@ echo "ARROW_SOURCE_DIR=${ARROW_SOURCE_DIR}" echo "ARROW_INSTALL_DIR=${ARROW_INSTALL_DIR}" mkdir -p $ARROW_SOURCE_DIR mkdir -p $ARROW_INSTALL_DIR -git clone https://github.com/oap-project/arrow.git --branch arrow-4.0.0-oap $ARROW_SOURCE_DIR +git clone https://github.com/PHILO-HE/arrow.git --branch port-hex $ARROW_SOURCE_DIR pushd $ARROW_SOURCE_DIR cmake ./cpp \ From 3ad9129a79c391795a095703001686b8cb0a3b0f Mon Sep 17 00:00:00 2001 From: philo Date: Tue, 14 Jun 2022 23:22:42 +0800 Subject: [PATCH 3/3] Revert "Change arrow branch [will revert at last]" This reverts commit ad742614b0af47c7fe7769daf00e24a3588e57c9. --- arrow-data-source/script/build_arrow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arrow-data-source/script/build_arrow.sh b/arrow-data-source/script/build_arrow.sh index d055d5cc9..d8ec40128 100755 --- a/arrow-data-source/script/build_arrow.sh +++ b/arrow-data-source/script/build_arrow.sh @@ -62,7 +62,7 @@ echo "ARROW_SOURCE_DIR=${ARROW_SOURCE_DIR}" echo "ARROW_INSTALL_DIR=${ARROW_INSTALL_DIR}" mkdir -p $ARROW_SOURCE_DIR mkdir -p $ARROW_INSTALL_DIR -git clone https://github.com/PHILO-HE/arrow.git --branch port-hex $ARROW_SOURCE_DIR +git clone https://github.com/oap-project/arrow.git --branch arrow-4.0.0-oap $ARROW_SOURCE_DIR pushd $ARROW_SOURCE_DIR cmake ./cpp \