You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Igor Seliverstov (Jira)" <ji...@apache.org> on 2020/04/15 09:01:00 UTC

[jira] [Comment Edited] (IGNITE-12566) Calcite integration. Expressions evaluation.

    [ https://issues.apache.org/jira/browse/IGNITE-12566?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17083931#comment-17083931 ] 

Igor Seliverstov edited comment on IGNITE-12566 at 4/15/20, 9:00 AM:
---------------------------------------------------------------------

List of needed operations implementations:
 AND
 OR 
 ABS
 ACOS
 AND
 ANY_VALUE
 ASCII
 ASIN
 ATAN
 ATAN2
 BIT_AND
 BIT_OR
 BIT_XOR
 CARDINALITY
 CASE
 CAST
 CBRT
 CEIL
 CHARACTER_LENGTH
 CHAR_LENGTH
 CLASSIFIER
 COALESCE
 COLLECT
 CONCAT
 COS
 COT
 COUNT
 CURRENT_CATALOG
 CURRENT_DATE
 CURRENT_PATH
 CURRENT_ROLE
 CURRENT_TIME
 CURRENT_TIMESTAMP
 CURRENT_USER
 CURRENT_VALUE
 DATETIME_PLUS
 DEFAULT
 DEGREES
 DENSE_RANK
 DIVIDE
 DIVIDE_INTEGER
 ELEMENT
 EQUALS
 EXP
 EXTRACT
 FIRST_VALUE
 FLOOR
 FUSION
 GREATER_THAN
 GREATER_THAN_OR_EQUAL
 GROUPING
 GROUPING_ID
 INITCAP
 IS_A_SET
 IS_EMPTY
 IS_FALSE
 IS_JSON_ARRAY
 IS_JSON_OBJECT
 IS_JSON_SCALAR
 IS_JSON_VALUE
 IS_NOT_A_SET
 IS_NOT_EMPTY
 IS_NOT_FALSE
 IS_NOT_JSON_ARRAY
 IS_NOT_JSON_OBJECT
 IS_NOT_JSON_SCALAR
 IS_NOT_JSON_VALUE
 IS_NOT_NULL
 IS_NOT_TRUE
 IS_NULL
 IS_TRUE
 ITEM
 JSON_ARRAY
 JSON_ARRAYAGG
 JSON_EXISTS
 JSON_OBJECT
 JSON_OBJECTAGG
 JSON_QUERY
 JSON_VALUE_ANY
 JSON_VALUE_EXPRESSION
 LAG
 LAST
 LAST_DAY
 LAST_VALUE
 LEAD
 LESS_THAN
 LESS_THAN_OR_EQUAL
 LIKE
 LISTAGG
 LN
 LOCALTIME
 LOCALTIMESTAMP
 LOG10
 LOWER
 MAP_VALUE_CONSTRUCTOR
 MAX
 MEMBER_OF
 MIN
 MINUS
 MINUS_DATE
 MOD
 MULTIPLY
 MULTISET_EXCEPT
 MULTISET_EXCEPT_DISTINCT
 MULTISET_INTERSECT
 MULTISET_INTERSECT_DISTINCT
 MULTISET_UNION
 MULTISET_UNION_DISTINCT
 NEXT_VALUE
 NOT
 NOT_EQUALS
 NOT_LIKE
 NOT_SIMILAR_TO
 NOT_SUBMULTISET_OF
 NTH_VALUE
 NTILE
 OR
 OVERLAY
 PI
 PLUS
 POSITION
 POWER
 PREV
 RADIANS
 RAND
 RAND_INTEGER
 RANK
 REGR_COUNT
 REINTERPRET
 REPLACE
 ROUND
 ROW
 ROW_NUMBER
 SESSION_USER
 SIGN
 SIMILAR_TO
 SIN
 SINGLE_VALUE
 SLICE
 STRUCT_ACCESS
 SUBMULTISET_OF
 SUBSTRING
 SUM
 SUM0
 SYSTEM_USER
 TAN
 TRIM
 TRUNCATE
 TUMBLE_TVF
 UNARY_MINUS
 UNARY_PLUS
 UPPER
 USER
 Also we have to take into consideration types and types inference on different types are passed as function parameters (for example for math operations: DOUBLE + INTEGER = DOUBLE; INTEGER + BIG_INT = BIG_INT etc)

Calcite uses code generation to generate functions for each passed types combinations at runtime, it's possible to act the same way, but having classes cache to bind logical operation to already generated implementation (not to compile code each time)


was (Author: gvvinblade):
List of needed operations implementations:
AND
OR	
ABS
ACOS
AND
ANY_VALUE
ASCII
ASIN
ATAN
ATAN2
BIT_AND
BIT_OR
BIT_XOR
CARDINALITY
CASE
CAST
CBRT
CEIL
CHARACTER_LENGTH
CHAR_LENGTH
CLASSIFIER
COALESCE
COLLECT
CONCAT
COS
COT
COUNT
CURRENT_CATALOG
CURRENT_DATE
CURRENT_PATH
CURRENT_ROLE
CURRENT_TIME
CURRENT_TIMESTAMP
CURRENT_USER
CURRENT_VALUE
DATETIME_PLUS
DEFAULT
DEGREES
DENSE_RANK
DIVIDE
DIVIDE_INTEGER
ELEMENT
EQUALS
EXP
EXTRACT
FIRST_VALUE
FLOOR
FUSION
GREATER_THAN
GREATER_THAN_OR_EQUAL
GROUPING
GROUPING_ID
INITCAP
IS_A_SET
IS_EMPTY
IS_FALSE
IS_JSON_ARRAY
IS_JSON_OBJECT
IS_JSON_SCALAR
IS_JSON_VALUE
IS_NOT_A_SET
IS_NOT_EMPTY
IS_NOT_FALSE
IS_NOT_JSON_ARRAY
IS_NOT_JSON_OBJECT
IS_NOT_JSON_SCALAR
IS_NOT_JSON_VALUE
IS_NOT_NULL
IS_NOT_TRUE
IS_NULL
IS_TRUE
ITEM
JSON_ARRAY
JSON_ARRAYAGG
JSON_EXISTS
JSON_OBJECT
JSON_OBJECTAGG
JSON_QUERY
JSON_VALUE_ANY
JSON_VALUE_EXPRESSION
LAG
LAST
LAST_DAY
LAST_VALUE
LEAD
LESS_THAN
LESS_THAN_OR_EQUAL
LIKE
LISTAGG
LN
LOCALTIME
LOCALTIMESTAMP
LOG10
LOWER
MAP_VALUE_CONSTRUCTOR
MAX
MEMBER_OF
MIN
MINUS
MINUS_DATE
MOD
MULTIPLY
MULTISET_EXCEPT
MULTISET_EXCEPT_DISTINCT
MULTISET_INTERSECT
MULTISET_INTERSECT_DISTINCT
MULTISET_UNION
MULTISET_UNION_DISTINCT
NEXT_VALUE
NOT
NOT_EQUALS
NOT_LIKE
NOT_SIMILAR_TO
NOT_SUBMULTISET_OF
NTH_VALUE
NTILE
OR
OVERLAY
PI
PLUS
POSITION
POWER
PREV
RADIANS
RAND
RAND_INTEGER
RANK
REGR_COUNT
REINTERPRET
REPLACE
ROUND
ROW
ROW_NUMBER
SESSION_USER
SIGN
SIMILAR_TO
SIN
SINGLE_VALUE
SLICE
STRUCT_ACCESS
SUBMULTISET_OF
SUBSTRING
SUM
SUM0
SYSTEM_USER
TAN
TRIM
TRUNCATE
TUMBLE_TVF
UNARY_MINUS
UNARY_PLUS
UPPER
USER
Also we have to take into consideration types and types inference on different types are passed as function parameters (for example for math operations: DOUBLE + INTEGER = DOUBLE; INTEGER + BIG_INT = BIG_INT etc)

> Calcite integration. Expressions evaluation.
> --------------------------------------------
>
>                 Key: IGNITE-12566
>                 URL: https://issues.apache.org/jira/browse/IGNITE-12566
>             Project: Ignite
>          Issue Type: Task
>            Reporter: Igor Seliverstov
>            Assignee: Igor Seliverstov
>            Priority: Major
>
> Currently we use a part of Calcite "Bindables" to evaluate expressions at the execution time. Using it we 
>  * lose a control on how expressions are evaluated
>  * cannot implement several important optimizations, like "keepBinary"
>  * can use only Object[] as a row, which causes a lot of array copy operations and unnecessary allocations at the execution time
>  * suffer from delays, which go from expressions compilation process when it's more efficient to start from interpretation and compile an expression on repeatable execution only
> We need to implement expressions interpreter and our own expression compiler taking Ignite specifics in consideration.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)