[
https://issues.apache.org/jira/browse/TAJO-1922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15010572#comment-15010572
]
ASF GitHub Bot commented on TAJO-1922:
--------------------------------------
Github user blrunner commented on a diff in the pull request:
https://github.com/apache/tajo/pull/819#discussion_r45176513
--- Diff:
tajo-plan/src/main/java/org/apache/tajo/plan/util/EvalNodeToExprConverter.java
---
@@ -178,65 +204,28 @@ protected EvalNode visitConst(Object o, ConstEval
evalNode, Stack<EvalNode> stac
break;
case TIMESTAMP:
- TimestampDatum timestampDatum = (TimestampDatum)
evalNode.getValue();
+ TimestampDatum timestampDatum = (TimestampDatum) datum;
dateValue = new DateValue(""+timestampDatum.getYear(),
""+timestampDatum.getMonthOfYear(),
""+timestampDatum.getDayOfMonth());
timeValue = new TimeValue(""+timestampDatum.getHourOfDay()
- , ""+timestampDatum.getMinuteOfHour(),
""+timestampDatum.getSecondOfMinute());
+ , ""+timestampDatum.getMinuteOfHour(),
""+timestampDatum.getSecondOfMinute());
value = new TimestampLiteral(dateValue, timeValue);
break;
case TIME:
- TimeDatum timeDatum = (TimeDatum) evalNode.getValue();
+ TimeDatum timeDatum = (TimeDatum) datum;
timeValue = new TimeValue(""+timeDatum.getHourOfDay()
, ""+timeDatum.getMinuteOfHour(),
""+timeDatum.getSecondOfMinute());
value = new TimeLiteral(timeValue);
break;
default:
- throw new RuntimeException("Unsupported type: " +
evalNode.getValueType().getType().name());
- }
- exprs.push(value);
-
- return super.visitConst(o, evalNode, stack);
- }
-
- @Override
- protected EvalNode visitRowConstant(Object o, RowConstantEval evalNode,
Stack<EvalNode> stack) {
- Expr[] values = new Expr[evalNode.getValues().length];
- for (int i = 0; i < evalNode.getValues().length; i++) {
- Datum datum = evalNode.getValues()[i];
- LiteralValue value;
- switch (datum.type()) {
- case BOOLEAN:
- value = new LiteralValue(datum.asChars(),
LiteralValue.LiteralType.Boolean);
- break;
- case TEXT:
- value = new LiteralValue(datum.asChars(),
LiteralValue.LiteralType.String);
- break;
- case INT1:
- case INT2:
- case INT4:
- value = new LiteralValue(datum.asChars(),
LiteralValue.LiteralType.Unsigned_Integer);
- break;
- case INT8:
- value = new LiteralValue(datum.asChars(),
LiteralValue.LiteralType.Unsigned_Large_Integer);
- break;
- case FLOAT4:
- case FLOAT8:
- value = new LiteralValue(datum.asChars(),
LiteralValue.LiteralType.Unsigned_Float);
- break;
- default:
- throw new RuntimeException("Unsupported type: " +
datum.type().name());
- }
- values[i] = value;
+ throw new RuntimeException("Unsupported type: " + type.name());
--- End diff --
Thanks @jihoonson . I reflected the patch with your comments. :)
> Allow date types with IN operator for partition pruning.
> --------------------------------------------------------
>
> Key: TAJO-1922
> URL: https://issues.apache.org/jira/browse/TAJO-1922
> Project: Tajo
> Issue Type: Sub-task
> Components: Catalog
> Affects Versions: 0.12.0
> Reporter: Jaehwa Jung
> Assignee: Jaehwa Jung
> Fix For: 0.12.0
>
>
> Currently, Tajo doesn't allow date types with IN operator for partition
> pruning. If users execute date types with IN operator with partitioned table,
> users will fail to execute their query as following:
> {code:xml}
> tpch_partition> \d lineitem
> table name: tpch_partition.lineitem
> table uri: hdfs://localhost:9010/tajo/warehouse/tpch_partition/lineitem
> store type: TEXT
> number of rows: 0
> volume: 696.5 MB
> Options:
> 'transient_lastDdlTime'='1441266430'
> 'text.null'='\\N'
> 'text.delimiter'='|'
> schema:
> l_orderkey INT8
> l_partkey INT8
> l_suppkey INT8
> l_linenumber INT8
> l_quantity FLOAT8
> l_extendedprice FLOAT8
> l_discount FLOAT8
> l_tax FLOAT8
> l_returnflag TEXT
> l_linestatus TEXT
> l_commitdate DATE
> l_receiptdate DATE
> l_shipinstruct TEXT
> l_shipmode TEXT
> l_comment TEXT
> Partitions:
> type:COLUMN
> columns::tpch_partition.lineitem.l_shipdate (DATE)
> tpch_partition> select l_shipdate, count(*) from lineitem where l_shipdate in
> ( to_date('1992-01-02', 'YYYY-MM-DD')
> > , to_date('1992-02-24', 'YYYY-MM-DD')) group by l_shipdate;
> ERROR: internal error: Unsupported type: DATE
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)