[
https://issues.apache.org/jira/browse/TAJO-906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14092489#comment-14092489
]
ASF GitHub Bot commented on TAJO-906:
-------------------------------------
GitHub user hyunsik opened a pull request:
https://github.com/apache/tajo/pull/113
TAJO-906: Runtime code generation for evaluating expression trees.
This is still an ongoing work. I share it for reviewing an overall
approach.
Note that this patch includes some third party library because the version
of ow2.asm is conflict to Hadoop's one. So, we don't need to review ow2.asm.
Also, this patch still does not pass one unit test related to
IntervalDatum. I'll fix it soon.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/hyunsik/tajo TAJO-906
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/tajo/pull/113.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #113
----
commit b922a35a0f76e4ebc172d51418ed84e92837054f
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-02T13:18:44Z
added some sample codes.
commit 6dd5a2769d6b8be28b328647844401ddbca77c07
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-14T01:06:14Z
add some base codegen.
commit f735f6d35071878368f3c81591058dfe01c904a9
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-14T01:06:58Z
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into
CodeGen
commit d9bc2f00be3b5b5d713d7c2a6691b9fffb024824
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-14T17:55:44Z
add arithmetic generation code.
commit 9146667dcc452156ed18ad4c46a1ea45068a9a75
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-15T05:11:42Z
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into
CodeGen
commit a83355b12be2d6f5157156147e8634b545443aa8
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-16T15:02:58Z
Removed duplicated InvalidCastException and Refactored InvalidCastException
and InvalidOperation.
commit 32dbcde96c44db6c16c859877dfd855f8cb6ef3c
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-16T15:03:31Z
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into
CodeGen
commit 72fbf9c86e969f5a2c1a3dd423638d3ac816fa1d
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-17T00:38:52Z
Refactor EvalNode to be one of UnaryEval, BinaryEval, or subclass of
EvalNode.
commit 1dab2aa71a1889a557542e354f810c9ad2c87908
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-17T01:38:52Z
fill visitConst()
commit ae74d2bb2d747a6aa69fe11e7d98906faa047763
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-18T15:06:08Z
Add visitField and improved ExprBaseTest to use CodeGen.
commit 8044fd9ee624c9fa3d72d64e3f106e772950825c
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-18T16:07:25Z
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into
CodeGen
Conflicts:
tajo-common/src/main/java/org/apache/tajo/exception/InvalidCastException.java
tajo-core/src/main/java/org/apache/tajo/engine/eval/EvalTreeUtil.java
tajo-core/src/main/java/org/apache/tajo/engine/eval/InvalidCastException.java
tajo-core/src/main/java/org/apache/tajo/engine/planner/PlannerUtil.java
tajo-core/src/main/java/org/apache/tajo/engine/planner/rewrite/FilterPushDownRule.java
tajo-core/tajo-core-backend/pom.xml
tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/eval/InvalidCastException.java
commit 4e1e55902e06690d2db82d91bc7c1be2fa68d758
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-19T06:08:40Z
Refactoring some method and simplified arithmetic operators.
commit af8ca5a398078f621ab7bb97b9dd187261e48469
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-19T06:09:02Z
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into
CodeGen
commit 741b1b67f833f88f4f5fd7d94140adc2fe1d350f
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-21T19:20:24Z
add comparison code generator.
commit fe4fca74007e7b7085034d5c791883604653a221
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-22T16:51:28Z
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into
CodeGen
Conflicts:
tajo-core/src/main/java/org/apache/tajo/engine/eval/EvalTreeUtil.java
tajo-core/src/main/java/org/apache/tajo/engine/eval/NotEval.java
tajo-core/src/main/java/org/apache/tajo/engine/eval/SignedEval.java
commit 840eaf29f7da323a3ba88f27333cd15e56aadf33
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-22T16:51:37Z
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into
CodeGen
commit 06d08c22b75438ddb2a2bf97c5dc37c8492fcc90
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-25T20:24:58Z
passed all tests.
commit 493aa9f47e703cbb1b758503bc31606fc0fa4fd8
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-26T17:50:00Z
Improved many things.
commit a467f85b5a1bb94780782e37ab3a517285f9f1df
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-26T17:50:10Z
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into
CodeGen
commit 924984533c920a35df0d328cd1b3e86722f4180d
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-26T20:52:37Z
added unit tests and improved null handling for all operations.
commit 6255737530ef3f887f8eda22726e567cd713bafa
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-27T19:17:57Z
improved implicit type conversion.
commit 72bc4b06b67522e15050c29cfdc8ff3d44a5c238
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-27T19:18:14Z
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into
CodeGen
commit 54d1a7acb798a5c0134a0c249f8ba7acd23a9365
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-28T14:13:11Z
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into
CodeGen
commit 61aca902f291d3184b3320828bdf36d331615fee
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-28T14:55:58Z
all unit tests are passed.
commit 00a1498e99a499f9fa18bcc0c86e20c34f6680ec
Author: Hyunsik Choi <[email protected]>
Date: 2014-04-29T01:55:06Z
Moved more test from codegen.
commit a1674079f9e7cd17059e745a8dbcad511a5c23b8
Author: Hyunsik Choi <[email protected]>
Date: 2014-05-04T17:49:58Z
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into
CodeGen
Conflicts:
tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogUtil.java
tajo-common/src/main/java/org/apache/tajo/datum/BooleanDatum.java
tajo-common/src/main/java/org/apache/tajo/datum/exception/InvalidCastException.java
tajo-common/src/main/java/org/apache/tajo/exception/InvalidCastException.java
tajo-common/src/main/java/org/apache/tajo/util/TUtil.java
tajo-core/src/main/java/org/apache/tajo/engine/codegen/CodeGenException.java
tajo-core/src/main/java/org/apache/tajo/engine/eval/AlgebraicUtil.java
tajo-core/src/main/java/org/apache/tajo/engine/eval/EvalTreeUtil.java
tajo-core/src/main/java/org/apache/tajo/engine/eval/EvalType.java
tajo-core/src/main/java/org/apache/tajo/engine/eval/SimpleEvalNodeVisitor.java
tajo-core/src/main/java/org/apache/tajo/engine/eval/UnaryEval.java
tajo-core/src/main/java/org/apache/tajo/engine/planner/ExprAnnotator.java
tajo-core/src/test/java/example/Example.java
tajo-core/src/test/java/org/apache/tajo/engine/eval/TestSQLExpression.java
commit c3dbd41cba5156eaf1badca78a4419ad78a15d18
Author: Hyunsik Choi <[email protected]>
Date: 2014-05-08T05:03:08Z
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into
CodeGen
commit 80a9566acb8bf2ef3624d31330b46070a8dd97cf
Author: Hyunsik Choi <[email protected]>
Date: 2014-05-08T16:41:54Z
Add between clause.
commit 3618d7da5a9ed1d7ea75c6f13de26d43d6ab9fd3
Author: Hyunsik Choi <[email protected]>
Date: 2014-05-08T16:42:09Z
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into
CodeGen
commit 7baff45c551920fa2c2d26d2163687d936a11bba
Author: Hyunsik Choi <[email protected]>
Date: 2014-05-08T16:51:08Z
Removed the case where the length of char type is 1.
----
> Runtime code generation for evaluating expression trees
> -------------------------------------------------------
>
> Key: TAJO-906
> URL: https://issues.apache.org/jira/browse/TAJO-906
> Project: Tajo
> Issue Type: Sub-task
> Components: physical operator
> Reporter: Hyunsik Choi
> Assignee: Hyunsik Choi
> Fix For: 0.9.0
>
>
> We have used EvalNode for two purposes:
> * logical planning of expressions
> * evaluation of expressions
> EvalNode still is very nice for the purpose of logical planning. But, each
> EvalNode tree takes Datum included in a tuple and results in a Datum as a
> evaluation result.
> So, the current approach requires many object creations, and causes interpret
> overheads, meaning that each one evaluation involves tree traverses and many
> function calls. interpretation involves also many branches, and it is harmful
> to CPU pipelining.
> I propose Java byte code generation for each expression, and I'll use ASM
> (http://asm.ow2.org/) for it. This approach will write native java byte code,
> eliminating many condition branches and function calls. In addition, it is
> easier to deal with java primitive data types for expressions.
--
This message was sent by Atlassian JIRA
(v6.2#6252)