[
https://issues.apache.org/jira/browse/CALCITE-1392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15529843#comment-15529843
]
Maciej Bryński edited comment on CALCITE-1392 at 9/28/16 2:50 PM:
------------------------------------------------------------------
I didn't.
And I don't have "__time" column in my data source. I was sure that this is
meta column created by calcite itself. And it's type is not VARCHAR but BIGINT
Especially with this quote from calcite page suggest that there is not nead to
do anything.
https://calcite.apache.org/docs/druid_adapter.html
{quote}
Simplifying the modelPermalink
If less metadata is provided in the model, the Druid adapter can discover it
automatically from Druid. Here is a schema equivalent to the previous one but
with dimensions, metrics and timestampColumn removed:
{quote}
was (Author: maver1ck):
I didn't.
And I don't have "__time" column in my data source. I was sure that this is
meta column created by calcite itself. And it's type is not VARCHAR but BIGINT
Especially with this quote from calcite page
https://calcite.apache.org/docs/druid_adapter.html
{quote}
Simplifying the modelPermalink
If less metadata is provided in the model, the Druid adapter can discover it
automatically from Druid. Here is a schema equivalent to the previous one but
with dimensions, metrics and timestampColumn removed:
{quote}
> Unable to specify time granularity for Druid
> --------------------------------------------
>
> Key: CALCITE-1392
> URL: https://issues.apache.org/jira/browse/CALCITE-1392
> Project: Calcite
> Issue Type: Bug
> Components: druid
> Affects Versions: 1.9.0
> Reporter: Maciej Bryński
> Assignee: Julian Hyde
>
> Druid 0.9.1.1
> Calcite 1.9.0
> I'm trying to calculate count per day.
> What I'm doing wrong ?
> {code}
> !connect
> jdbc:calcite:schemaFactory=org.apache.calcite.adapter.druid.DruidSchemaFactory
> admin admin
> 0: jdbc:calcite:schemaFactory=org.apache.calc> !describe "table"
> +-----------+-------------+------------+-------------+-----------+-----------+-------------+---------------+----------------+----------------+----------+---------+------------+---------------+------------------+
> | TABLE_CAT | TABLE_SCHEM | TABLE_NAME | COLUMN_NAME | DATA_TYPE | TYPE_NAME
> | COLUMN_SIZE | BUFFER_LENGTH | DECIMAL_DIGITS | NUM_PREC_RADIX | NULLABLE |
> REMARKS | COLUMN_DEF | SQL_DATA_TYPE | SQL_DATETIME_SUB |
> +-----------+-------------+------------+-------------+-----------+-----------+-------------+---------------+----------------+----------------+----------+---------+------------+---------------+------------------+
> | | adhoc | table | __time | -5 | BIGINT | -1
> | | null | 10 | 1 |
> | | | |
> |
> | | adhoc | table | count | -5 | BIGINT |
> -1 | | null | 10 | 1 |
> | | |
> 0: jdbc:calcite:schemaFactory=org.apache.calc> select sum("count") from
> "table" group by floor("__time" to DAY);
> 2016-09-27 21:50:26,770 [main] ERROR -
> org.apache.calcite.sql.validate.SqlValidatorException: Cannot apply 'FLOOR'
> to arguments of type 'FLOOR(<BIGINT>, <INTERVAL DAY>)'. Supported form(s):
> 'FLOOR(<NUMERIC>)'
> 'FLOOR(<DATETIME_INTERVAL>)'
> 'FLOOR(<DATE> TO <TIME_UNIT>)'
> 'FLOOR(<TIME> TO <TIME_UNIT>)'
> 'FLOOR(<TIMESTAMP> TO <TIME_UNIT>)'
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)