[
https://issues.apache.org/jira/browse/KYLIN-1216?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Yerui Sun updated KYLIN-1216:
-----------------------------
Attachment: KYLIN-1216-2.x-staging.patch
> Can't parse DateFormat like 'YYYYMMDD' correctly in query
> ---------------------------------------------------------
>
> Key: KYLIN-1216
> URL: https://issues.apache.org/jira/browse/KYLIN-1216
> Project: Kylin
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 1.2, 2.0
> Reporter: Yerui Sun
> Assignee: Yerui Sun
> Fix For: 1.2, 2.0
>
> Attachments: KYLIN-1216-1.x-staging.patch,
> KYLIN-1216-2.x-staging.patch
>
>
> Kylin has support date format as 'YYYYMMDD' since KYLIN-1101, and could read
> data and build cube successfully with this format.
> However, the query sql contains " dt='20151208' " can't be parsed, the reason
> is HBaseKeyRange.initPartitionRange still using default format 'YYYY-MM-DD'
> only, not read from partition desc.
> Here's the trace:
> {code}
> Caused by: java.lang.IllegalArgumentException: '20150901' is not a valid date
> of pattern 'yyyy-MM-dd'
> at
> org.apache.kylin.common.util.DateFormat.stringToDate(DateFormat.java:78)
> at
> org.apache.kylin.common.util.DateFormat.stringToDate(DateFormat.java:70)
> at
> org.apache.kylin.storage.hbase.HBaseKeyRange.initPartitionRange(HBaseKeyRange.java:148)
> at
> org.apache.kylin.storage.hbase.HBaseKeyRange.init(HBaseKeyRange.java:127)
> at
> org.apache.kylin.storage.hbase.HBaseKeyRange.<init>(HBaseKeyRange.java:101)
> at
> org.apache.kylin.storage.hbase.CubeStorageEngine.buildScanRanges(CubeStorageEngine.java:410)
> at
> org.apache.kylin.storage.hbase.CubeStorageEngine.search(CubeStorageEngine.java:134)
> at
> org.apache.kylin.query.enumerator.CubeEnumerator.queryStorage(CubeEnumerator.java:149)
> at
> org.apache.kylin.query.enumerator.CubeEnumerator.moveNext(CubeEnumerator.java:74)
> at Baz$1$1.moveNext(Unknown Source)
> at
> org.apache.calcite.linq4j.EnumerableDefaults.groupBy_(EnumerableDefaults.java:737)
> at
> org.apache.calcite.linq4j.EnumerableDefaults.groupBy(EnumerableDefaults.java:677)
> at
> org.apache.calcite.linq4j.DefaultEnumerable.groupBy(DefaultEnumerable.java:301)
> at Baz.bind(Unknown Source)
> at
> org.apache.calcite.jdbc.CalcitePrepare$CalciteSignature.enumerable(CalcitePrepare.java:281)
> at
> org.apache.calcite.jdbc.CalciteConnectionImpl.enumerable(CalciteConnectionImpl.java:235)
> at
> org.apache.calcite.jdbc.CalciteMetaImpl.createIterable(CalciteMetaImpl.java:533)
> at
> org.apache.calcite.avatica.AvaticaResultSet.execute(AvaticaResultSet.java:184)
> at
> org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:63)
> at
> org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:42)
> at
> org.apache.calcite.avatica.AvaticaConnection$1.execute(AvaticaConnection.java:473)
> at
> org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:566)
> at
> org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:477)
> at
> org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:109)
> ... 83 more
> Caused by: java.text.ParseException: Unparseable date: "20150901"
> at java.text.DateFormat.parse(DateFormat.java:366)
> at
> org.apache.kylin.common.util.DateFormat.stringToDate(DateFormat.java:76)
> ... 106 more
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)