[jira] [Commented] (DRILL-4869) Some queries sent via JDBC get executed twice.

2016-08-31 Thread Oscar Morante (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-4869?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15451687#comment-15451687
 ] 

Oscar Morante commented on DRILL-4869:
--

If I revert {{e02aa596fa64f38bce773fd108f15032f8086601}} and 
{{14f6ec7dd9b010de6c884431e443eb788ce54339}} the same query gets executed only 
once.

> Some queries sent via JDBC get executed twice.
> --
>
> Key: DRILL-4869
> URL: https://issues.apache.org/jira/browse/DRILL-4869
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.8.0
>Reporter: Oscar Morante
>
> This didn't happen before the prepared statement changes so I guess it has 
> something to do with that:
> {noformat}
> 2016-08-31 11:00:20,520 [2839716a-9615-25a2-a285-cf38a187784e:foreman] INFO  
> o.a.drill.exec.work.foreman.Foreman - Prepared statement query for QueryId 
> part1: 2898472537788065186
> part2: -6735749825527580594
>  : select * from (values(1))
> {noformat}
> The query appears twice on the web interface but the second one doesn't have 
> the query text:
> http://i.imgur.com/QB0FOdz.png



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (DRILL-4869) Some queries sent via JDBC get executed twice.

2016-08-31 Thread Oscar Morante (JIRA)
Oscar Morante created DRILL-4869:


 Summary: Some queries sent via JDBC get executed twice.
 Key: DRILL-4869
 URL: https://issues.apache.org/jira/browse/DRILL-4869
 Project: Apache Drill
  Issue Type: Bug
Affects Versions: 1.8.0
Reporter: Oscar Morante


This didn't happen before the prepared statement changes so I guess it has 
something to do with that:

{noformat}
2016-08-31 11:00:20,520 [2839716a-9615-25a2-a285-cf38a187784e:foreman] INFO  
o.a.drill.exec.work.foreman.Foreman - Prepared statement query for QueryId 
part1: 2898472537788065186
part2: -6735749825527580594
 : select * from (values(1))
{noformat}

The query appears twice on the web interface but the second one doesn't have 
the query text:

http://i.imgur.com/QB0FOdz.png




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Closed] (DRILL-4341) Fails to parse string literals containing escaped quotes

2016-08-07 Thread Oscar Morante (JIRA)

 [ 
https://issues.apache.org/jira/browse/DRILL-4341?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Oscar Morante closed DRILL-4341.

   Resolution: Fixed
Fix Version/s: 1.8.0

This is now working.  I'm not sure when it got fixed but it's working just fine 
on master 18e16610ab446e1f435db35dd6dce60c0be0d07a.

> Fails to parse string literals containing escaped quotes
> 
>
> Key: DRILL-4341
> URL: https://issues.apache.org/jira/browse/DRILL-4341
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.5.0
>Reporter: Oscar Morante
> Fix For: 1.8.0
>
>
> In some situations, Drill fails to parse strings with escaped single quotes.  
> Just changing the last line of this query makes the problem appear and 
> disappear (without touching the string it's complaining about):
> {code:sql}
> select
>   '-MM-dd''T''HH:mm:ss.SSS''Z'''
> from
>   s3; --> FAILS
>   --s3.`2015`; --> FAILS
>   --s3.`2015/11`; --> FAILS
>   --s3.`2015/11/3`; --> WORKS
>   --s3.`2015/11/3/10-1072045-1612661.json.gz`; --> WORKS
>   --(select * from s3 limit 1); --> WORKS
>   --(select * from s3.`2015` limit 1); --> WORKS
>   --(select * from s3.`2015/11` limit 1); --> WORKS
> {code}
> This is the error when it fails:
> {code}
> ExampleExceptionFormatter: exception message was: SYSTEM ERROR: 
> ExpressionParsingException: Expression has syntax error! line 1:12:missing 
> EOF at 'T'
> Fragment 1:1
> {code}
> This is very important when dealing with json files containing dates encoded 
> as iso-8601 strings.  My current workaround is something like this:
> {code:sql}
> select to_timestamp(regexp_replace(`timestamp`, '[TZ]', ''),
> '-MM-ddHH:mm:ss.SSS')
> from s3;
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-3610) TimestampAdd/Diff (SQL_TSI_) functions

2016-02-25 Thread Oscar Morante (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-3610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15167542#comment-15167542
 ] 

Oscar Morante commented on DRILL-3610:
--

Tableau seems to use this for some aggregated extracts.

> TimestampAdd/Diff (SQL_TSI_) functions
> --
>
> Key: DRILL-3610
> URL: https://issues.apache.org/jira/browse/DRILL-3610
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Functions - Drill
>Reporter: Andries Engelbrecht
>Assignee: Arina Ielchiieva
> Fix For: Future
>
>
> Add TimestampAdd and TimestampDiff (SQL_TSI) functions for year, quarter, 
> month, week, day, hour, minute, second.
> Examples
> SELECT CAST(TIMESTAMPADD(SQL_TSI_QUARTER,1,Date('2013-03-31'), SQL_DATE) AS 
> `column_quarter`
> FROM `table_in`
> HAVING (COUNT(1) > 0)
> SELECT `table_in`.`datetime` AS `column1`,
>   `table`.`Key` AS `column_Key`,
>   TIMESTAMPDIFF(SQL_TSI_MINUTE,to_timestamp('2004-07-04', 
> '-MM-dd'),`table_in`.`datetime`) AS `sum_datediff_minute`
> FROM `calcs`



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-4340) Tableau complains about the ODBC driver capabilities

2016-02-03 Thread Oscar Morante (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-4340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15130286#comment-15130286
 ] 

Oscar Morante commented on DRILL-4340:
--

Oops! You're right, I was missing the TDC file.  Thanks!

> Tableau complains about the ODBC driver capabilities
> 
>
> Key: DRILL-4340
> URL: https://issues.apache.org/jira/browse/DRILL-4340
> Project: Apache Drill
>  Issue Type: Improvement
>Affects Versions: 1.5.0
>Reporter: Oscar Morante
>
> I'm testing Drill with Tableau via ODBC and when it connects it complains 
> about some missing features:
> {code}
> This ODBC driver does not support important capabilities used by Tableau.
> This unsupported function is required for relative date filters: The date 
> part named 'week' for the date function: DATETRUNC(date_part, date, 
> [start_of_week])
> -
> Tableau identified the following warnings for the ODBC data source named 
> 'test (s3.views.test)':
> This aggregation is unsupported: Attribute
> This aggregation is unsupported: Std. Dev
> This aggregation is unsupported: Std. Dev (Pop.)
> This aggregation is unsupported: Trunc Week Number
> This aggregation is unsupported: Variance
> This aggregation is unsupported: Variance (Pop.)
> This function is unsupported: % with parameter types 'integer, integer'
> This function is unsupported: ABS(number) with parameter types 'float'
> This function is unsupported: ABS(number) with parameter types 'integer'
> This function is unsupported: ACOS(number) with parameter types 'float'
> This function is unsupported: ASIN(number) with parameter types 'float'
> This function is unsupported: ATAN(number) with parameter types 'float'
> This function is unsupported: ATAN2(y number, x number) with parameter types 
> 'float, float'
> This function is unsupported: COS(angle) with parameter types 'float'
> This function is unsupported: COT(angle) with parameter types 'float'
> This function is unsupported: DATEPART_DAYOFWEEK_INTERNAL with parameter 
> types 'date'
> This function is unsupported: DATEPART_WEEK_INTERNAL with parameter types 
> 'date'
> This function is unsupported: DATETIME with parameter types 'integer'
> This function is unsupported: DEGREES(number) with parameter types 'float'
> This function is unsupported: EXP(number) with parameter types 'float'
> This function is unsupported: LN with parameter types 'float'
> This function is unsupported: LN(number) with parameter types 'float'
> This function is unsupported: LOG with parameter types 'float'
> This function is unsupported: LOG(number, [base]) with parameter types 'float'
> This function is unsupported: PI()
> This function is unsupported: POWER with parameter types 'float, integer'
> This function is unsupported: POWER with parameter types 'integer, integer'
> This function is unsupported: POWER(number,power) with parameter types 
> 'float, integer'
> This function is unsupported: POWER(number,power) with parameter types 
> 'integer, integer'
> This function is unsupported: RADIANS(number) with parameter types 'float'
> This function is unsupported: ROUND(number, [decimals]) with parameter types 
> 'float'
> This function is unsupported: ROUND(number, [decimals]) with parameter types 
> 'float, integer'
> This function is unsupported: SIGN(number) with parameter types 'float'
> This function is unsupported: SIN(angle) with parameter types 'float'
> This function is unsupported: SQRT(number) with parameter types 'float'
> This function is unsupported: SQUARE with parameter types 'float'
> This function is unsupported: TAN(angle) with parameter types 'float'
> This function is unsupported: The date part named 'week' for the date 
> function: DATEDIFF(date_part, start_date, end_date, [start_of_week])
> This function is unsupported: The date part named 'week' for the date 
> function: DATEDIFF(date_part, start_date, end_date, [start_of_week])
> This function is unsupported: The date part named 'week' for the date 
> function: DATENAME(date_part, date, [start_of_week])
> This function is unsupported: The date part named 'week' for the date 
> function: DATENAME(date_part, date, [start_of_week])
> This function is unsupported: The date part named 'week' for the date 
> function: DATEPART(date_part, date, [start_of_week])
> This function is unsupported: The date part named 'week' for the date 
> function: DATEPART(date_part, date, [start_of_week])
> This function is unsupported: The date part named 'weekday' for the date 
> function: DATENAME(date_part, date, [start_of_week])
> This function is unsupported: The date part named 'weekday' for the date 
> function: DATENAME(date_part, date, [start_of_week])
> This function is unsupported: The date part named 'weekday' for the date 
> function: DATEPART(date_part, date, [start_of_week])
> This function is 

[jira] [Closed] (DRILL-4340) Tableau complains about the ODBC driver capabilities

2016-02-03 Thread Oscar Morante (JIRA)

 [ 
https://issues.apache.org/jira/browse/DRILL-4340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Oscar Morante closed DRILL-4340.

Resolution: Not A Problem

> Tableau complains about the ODBC driver capabilities
> 
>
> Key: DRILL-4340
> URL: https://issues.apache.org/jira/browse/DRILL-4340
> Project: Apache Drill
>  Issue Type: Improvement
>Affects Versions: 1.5.0
>Reporter: Oscar Morante
>
> I'm testing Drill with Tableau via ODBC and when it connects it complains 
> about some missing features:
> {code}
> This ODBC driver does not support important capabilities used by Tableau.
> This unsupported function is required for relative date filters: The date 
> part named 'week' for the date function: DATETRUNC(date_part, date, 
> [start_of_week])
> -
> Tableau identified the following warnings for the ODBC data source named 
> 'test (s3.views.test)':
> This aggregation is unsupported: Attribute
> This aggregation is unsupported: Std. Dev
> This aggregation is unsupported: Std. Dev (Pop.)
> This aggregation is unsupported: Trunc Week Number
> This aggregation is unsupported: Variance
> This aggregation is unsupported: Variance (Pop.)
> This function is unsupported: % with parameter types 'integer, integer'
> This function is unsupported: ABS(number) with parameter types 'float'
> This function is unsupported: ABS(number) with parameter types 'integer'
> This function is unsupported: ACOS(number) with parameter types 'float'
> This function is unsupported: ASIN(number) with parameter types 'float'
> This function is unsupported: ATAN(number) with parameter types 'float'
> This function is unsupported: ATAN2(y number, x number) with parameter types 
> 'float, float'
> This function is unsupported: COS(angle) with parameter types 'float'
> This function is unsupported: COT(angle) with parameter types 'float'
> This function is unsupported: DATEPART_DAYOFWEEK_INTERNAL with parameter 
> types 'date'
> This function is unsupported: DATEPART_WEEK_INTERNAL with parameter types 
> 'date'
> This function is unsupported: DATETIME with parameter types 'integer'
> This function is unsupported: DEGREES(number) with parameter types 'float'
> This function is unsupported: EXP(number) with parameter types 'float'
> This function is unsupported: LN with parameter types 'float'
> This function is unsupported: LN(number) with parameter types 'float'
> This function is unsupported: LOG with parameter types 'float'
> This function is unsupported: LOG(number, [base]) with parameter types 'float'
> This function is unsupported: PI()
> This function is unsupported: POWER with parameter types 'float, integer'
> This function is unsupported: POWER with parameter types 'integer, integer'
> This function is unsupported: POWER(number,power) with parameter types 
> 'float, integer'
> This function is unsupported: POWER(number,power) with parameter types 
> 'integer, integer'
> This function is unsupported: RADIANS(number) with parameter types 'float'
> This function is unsupported: ROUND(number, [decimals]) with parameter types 
> 'float'
> This function is unsupported: ROUND(number, [decimals]) with parameter types 
> 'float, integer'
> This function is unsupported: SIGN(number) with parameter types 'float'
> This function is unsupported: SIN(angle) with parameter types 'float'
> This function is unsupported: SQRT(number) with parameter types 'float'
> This function is unsupported: SQUARE with parameter types 'float'
> This function is unsupported: TAN(angle) with parameter types 'float'
> This function is unsupported: The date part named 'week' for the date 
> function: DATEDIFF(date_part, start_date, end_date, [start_of_week])
> This function is unsupported: The date part named 'week' for the date 
> function: DATEDIFF(date_part, start_date, end_date, [start_of_week])
> This function is unsupported: The date part named 'week' for the date 
> function: DATENAME(date_part, date, [start_of_week])
> This function is unsupported: The date part named 'week' for the date 
> function: DATENAME(date_part, date, [start_of_week])
> This function is unsupported: The date part named 'week' for the date 
> function: DATEPART(date_part, date, [start_of_week])
> This function is unsupported: The date part named 'week' for the date 
> function: DATEPART(date_part, date, [start_of_week])
> This function is unsupported: The date part named 'weekday' for the date 
> function: DATENAME(date_part, date, [start_of_week])
> This function is unsupported: The date part named 'weekday' for the date 
> function: DATENAME(date_part, date, [start_of_week])
> This function is unsupported: The date part named 'weekday' for the date 
> function: DATEPART(date_part, date, [start_of_week])
> This function is unsupported: The date part named 'weekday' for the date 
> function: 

[jira] [Created] (DRILL-4341) Fails to parse string literals containing escaped quotes

2016-02-02 Thread Oscar Morante (JIRA)
Oscar Morante created DRILL-4341:


 Summary: Fails to parse string literals containing escaped quotes
 Key: DRILL-4341
 URL: https://issues.apache.org/jira/browse/DRILL-4341
 Project: Apache Drill
  Issue Type: Bug
Affects Versions: 1.5.0
Reporter: Oscar Morante


In some situations, Drill fails to parse strings with escaped single quotes.  
Just changing the last line of this query makes the problem appear and 
disappear (without touching the string it's complaining about):

{code:sql}
select
  '-MM-dd''T''HH:mm:ss.SSS''Z'''
from
  s3; --> FAILS
  --s3.`2015`; --> FAILS
  --s3.`2015/11`; --> FAILS
  --s3.`2015/11/3`; --> WORKS
  --s3.`2015/11/3/10-1072045-1612661.json.gz`; --> WORKS
  --(select * from s3 limit 1); --> WORKS
  --(select * from s3.`2015` limit 1); --> WORKS
  --(select * from s3.`2015/11` limit 1); --> WORKS
{code}

This is the error when it fails:

{code}
ExampleExceptionFormatter: exception message was: SYSTEM ERROR: 
ExpressionParsingException: Expression has syntax error! line 1:12:missing EOF 
at 'T'

Fragment 1:1
{code}

This is very important when dealing with json files containing dates encoded as 
iso-8601 strings.  My current workaround is something like this:

{code:sql}
select to_timestamp(regexp_replace(`timestamp`, '[TZ]', ''),
'-MM-ddHH:mm:ss.SSS')
from s3;
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-2669) Error happening without limit clause and works with limit clause

2016-02-02 Thread Oscar Morante (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-2669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15128097#comment-15128097
 ] 

Oscar Morante commented on DRILL-2669:
--

I've been doing some more testing and I think the problem is that in some 
situations it fails to parse strings with escaped single quotes.  Just changing 
the last line of this query makes the problem appear and disappear (without 
touching the string it's complaining about):

{code:sql}
select
  '-MM-dd''T''HH:mm:ss.SSS''Z'''
from
  raw; --> FAILS
  --raw.`*`; --> FAILS
  --raw.`2015`; --> FAILS
  --raw.`2015/11`; --> FAILS
  --raw.`2015/11/3`; --> WORKS
  --raw.`2015/11/3/10-1072045-1612661.json.gz`; --> WORKS
  --(select * from raw limit 1); --> WORKS
  --(select * from raw.`*` limit 1); --> WORKS
  --(select * from raw.`2015` limit 1); --> WORKS
  --(select * from raw.`2015/11` limit 1); --> WORKS
{code}

This query gives a simpler error:

{code}
ExampleExceptionFormatter: exception message was: SYSTEM ERROR: 
ExpressionParsingException: Expression has syntax error! line 1:12:missing EOF 
at 'T'

Fragment 1:1
{code}

> Error happening without limit clause and works with limit clause
> 
>
> Key: DRILL-2669
> URL: https://issues.apache.org/jira/browse/DRILL-2669
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Functions - Drill
>Affects Versions: 0.8.0
> Environment: mapr sandbox 4.0.2
>Reporter: Sudhakar Thota
> Fix For: Future
>
>
> Perhaps this could be a bug. I get the same results.
> But the plan is very different, the UnionExchange is set up immediately after 
> the scan operation in successful case( Case 1 ), where as UnionExchange is 
> happening after scan>project (Case -2).
> Case -1.Successful case.
> {code}
> 0: jdbc:drill:> explain plan for select to_timestamp(t.t, 
> '-MM-dd''T''HH:mm:ss.SSS''Z''') FROM (select * from 
> dfs.sthota_prq.`/tstamp_test/*.parquet` limit 13015351) t;
> --+
> text  json
> --+
> 00-00 Screen
> 00-01 Project(EXPR$0=[TO_TIMESTAMP(ITEM($0, 't'), 
> '-MM-dd''T''HH:mm:ss.SSS''Z''')])
> 00-02 SelectionVectorRemover
> 00-03 Limit(fetch=[13015351])
> 00-04 UnionExchange
> 01-01 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath 
> [path=maprfs:/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test/1_2_0.parquet],
>  ReadEntryWithPath 
> [path=maprfs:/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test/1_1_0.parquet],
>  ReadEntryWithPath 
> [path=maprfs:/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test/1_0_0.parquet]],
>  selectionRoot=/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test, 
> numFiles=3, columns=[`*`]]])
> {
> "head" :
> Unknown macro: { "version" }
> ,
> {code}
> Case -2. Unsuccessful case:
> {code}
> 0: jdbc:drill:> explain plan for select to_timestamp(t.t, 
> '-MM-dd''T''HH:mm:ss.SSS''Z''') FROM (select * from 
> dfs.sthota_prq.`/tstamp_test/*.parquet` ) t;
> --+
> text  json
> --+
> 00-00 Screen
> 00-01 UnionExchange
> 01-01 Project(EXPR$0=[TO_TIMESTAMP(ITEM($0, 't'), 
> '-MM-dd''T''HH:mm:ss.SSS''Z''')])
> 01-02 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath 
> [path=maprfs:/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test/1_2_0.parquet],
>  ReadEntryWithPath 
> [path=maprfs:/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test/1_1_0.parquet],
>  ReadEntryWithPath 
> [path=maprfs:/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test/1_0_0.parquet]],
>  selectionRoot=/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test, 
> numFiles=3, columns=[`*`]]])
> {
> "head" :
> Unknown macro: { "version" }
> ,
> {code}
> {code}
> 0: jdbc:drill:> select to_timestamp(t.t, '-MM-dd''T''HH:mm:ss.SSS''Z''') 
> FROM (select * from dfs.sthota_prq.`/tstamp_test/*.parquet` limit 10) t;
> 
> EXPR$0
> 
> 2015-01-27 13:43:53.0
> 2015-01-27 13:43:49.0
> 2015-01-27 13:43:47.0
> 2015-01-27 13:43:47.0
> 2015-01-27 13:43:47.0
> 2015-01-27 13:43:45.0
> 2015-01-27 13:43:43.0
> 2015-01-27 13:43:43.0
> 2015-01-27 13:43:43.0
> 2015-01-27 13:43:39.0
> 
> 10 rows selected (1.127 seconds)
> {code}
> {code}
> 0: jdbc:drill:> select to_timestamp(t.t, '-MM-dd''T''HH:mm:ss.SSS''Z''') 
> FROM (select * from dfs.sthota_prq.`/tstamp_test/*.parquet`) t;
> {code}
> {code}
> 0: jdbc:drill:> select to_timestamp(t.t, '-MM-dd''T''HH:mm:ss.SSS''Z''') 
> FROM (select * from dfs.sthota_prq.`/tstamp_test/*.parquet`) t;
> Query failed: RemoteRpcException: Failure while trying to start remote 
> fragment, Expression has syntax error! line 1:30:mismatched input 'T' 
> expecting CParen [ ab817e5a-9b74-47dd-b3c6-3bbf025c7de9 on maprdemo:31010 ]
> Error: exception while executing query: Failure while executing query. 
> (state=,code=0)
> {code}




[jira] [Comment Edited] (DRILL-2669) Error happening without limit clause and works with limit clause

2016-02-01 Thread Oscar Morante (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-2669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15121303#comment-15121303
 ] 

Oscar Morante edited comment on DRILL-2669 at 2/1/16 6:49 PM:
--

Hi, I think I'm running into the same issue.  Given some json data with this 
shape:

{code:javascript}
{ "timestamp": "2015-11-03T07:21:24.066Z"}
{code}

This query fails:
{code}
select to_timestamp(`timestamp`, '-MM-dd''T''HH:mm:ss.SSS''Z''') from 
(select * from mydatasource);

Error: SYSTEM ERROR: ExpressionParsingException: Expression has syntax error! 
line 1:38:mismatched input 'T' expecting CParen

Fragment 1:3

[Error Id: e1f0fd04-52a4-4b79-bef6-7262a88a7e28 on 10.2.26.3:31010] 
(state=,code=0)
{code}

And this one works:
{code}
select to_timestamp(`timestamp`, '-MM-dd''T''HH:mm:ss.SSS''Z''') from 
(select * from mydatasource limit 1); 
{code}


was (Author: spacepluk):
Hi, I think I'm running into the same issue.  Given some json data with this 
shape:

{code:javascript}
{ "timestamp": "2015-11-03T07:21:24.066Z"}
{code}

This query fails:
{code}
select to_timestamp(`timestamp`, '-MM-dd''T''HH:mm:ss.SSS''Z''') from 
mydatasource limit 1;

Error: SYSTEM ERROR: ExpressionParsingException: Expression has syntax error! 
line 1:38:mismatched input 'T' expecting CParen

Fragment 1:3

[Error Id: e1f0fd04-52a4-4b79-bef6-7262a88a7e28 on 10.2.26.3:31010] 
(state=,code=0)
{code}

And this one works:
{code}
select to_timestamp(`timestamp`, '-MM-dd''T''HH:mm:ss.SSS''Z''') from 
(select * from mydatasource); 
{code}

UPDATE: I copy the wrong error, it's ok now.

> Error happening without limit clause and works with limit clause
> 
>
> Key: DRILL-2669
> URL: https://issues.apache.org/jira/browse/DRILL-2669
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Functions - Drill
>Affects Versions: 0.8.0
> Environment: mapr sandbox 4.0.2
>Reporter: Sudhakar Thota
> Fix For: Future
>
>
> Perhaps this could be a bug. I get the same results.
> But the plan is very different, the UnionExchange is set up immediately after 
> the scan operation in successful case( Case 1 ), where as UnionExchange is 
> happening after scan>project (Case -2).
> Case -1.Successful case.
> {code}
> 0: jdbc:drill:> explain plan for select to_timestamp(t.t, 
> '-MM-dd''T''HH:mm:ss.SSS''Z''') FROM (select * from 
> dfs.sthota_prq.`/tstamp_test/*.parquet` limit 13015351) t;
> --+
> text  json
> --+
> 00-00 Screen
> 00-01 Project(EXPR$0=[TO_TIMESTAMP(ITEM($0, 't'), 
> '-MM-dd''T''HH:mm:ss.SSS''Z''')])
> 00-02 SelectionVectorRemover
> 00-03 Limit(fetch=[13015351])
> 00-04 UnionExchange
> 01-01 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath 
> [path=maprfs:/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test/1_2_0.parquet],
>  ReadEntryWithPath 
> [path=maprfs:/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test/1_1_0.parquet],
>  ReadEntryWithPath 
> [path=maprfs:/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test/1_0_0.parquet]],
>  selectionRoot=/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test, 
> numFiles=3, columns=[`*`]]])
> {
> "head" :
> Unknown macro: { "version" }
> ,
> {code}
> Case -2. Unsuccessful case:
> {code}
> 0: jdbc:drill:> explain plan for select to_timestamp(t.t, 
> '-MM-dd''T''HH:mm:ss.SSS''Z''') FROM (select * from 
> dfs.sthota_prq.`/tstamp_test/*.parquet` ) t;
> --+
> text  json
> --+
> 00-00 Screen
> 00-01 UnionExchange
> 01-01 Project(EXPR$0=[TO_TIMESTAMP(ITEM($0, 't'), 
> '-MM-dd''T''HH:mm:ss.SSS''Z''')])
> 01-02 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath 
> [path=maprfs:/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test/1_2_0.parquet],
>  ReadEntryWithPath 
> [path=maprfs:/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test/1_1_0.parquet],
>  ReadEntryWithPath 
> [path=maprfs:/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test/1_0_0.parquet]],
>  selectionRoot=/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test, 
> numFiles=3, columns=[`*`]]])
> {
> "head" :
> Unknown macro: { "version" }
> ,
> {code}
> {code}
> 0: jdbc:drill:> select to_timestamp(t.t, '-MM-dd''T''HH:mm:ss.SSS''Z''') 
> FROM (select * from dfs.sthota_prq.`/tstamp_test/*.parquet` limit 10) t;
> 
> EXPR$0
> 
> 2015-01-27 13:43:53.0
> 2015-01-27 13:43:49.0
> 2015-01-27 13:43:47.0
> 2015-01-27 13:43:47.0
> 2015-01-27 13:43:47.0
> 2015-01-27 13:43:45.0
> 2015-01-27 13:43:43.0
> 2015-01-27 13:43:43.0
> 2015-01-27 13:43:43.0
> 2015-01-27 13:43:39.0
> 
> 10 rows selected (1.127 seconds)
> {code}
> {code}
> 0: jdbc:drill:> select to_timestamp(t.t, '-MM-dd''T''HH:mm:ss.SSS''Z''') 
> FROM (select * from 

[jira] [Comment Edited] (DRILL-2669) Error happening without limit clause and works with limit clause

2016-01-28 Thread Oscar Morante (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-2669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15121303#comment-15121303
 ] 

Oscar Morante edited comment on DRILL-2669 at 1/28/16 12:52 PM:


Hi, I think I'm running into the same issue.  Given some json data with this 
shape:

{code:javascript}
{ "timestamp": "2015-11-03T07:21:24.066Z"}
{code}

This query fails:
{code}
select to_timestamp(`timestamp`, '-MM-dd''T''HH:mm:ss.SSS''Z''') from 
mydatasource limit 1;

Error: SYSTEM ERROR: ExpressionParsingException: Expression has syntax error! 
line 1:38:mismatched input 'T' expecting CParen

Fragment 1:3

[Error Id: e1f0fd04-52a4-4b79-bef6-7262a88a7e28 on 10.2.26.3:31010] 
(state=,code=0)
{code}

And this one works:
{code}
select to_timestamp(`timestamp`, '-MM-dd''T''HH:mm:ss.SSS''Z''') from 
(select * from mydatasource); 
{code}

UPDATE: I copy the wrong error, it's ok now.


was (Author: spacepluk):
Hi, I think I'm running into the same issue.  Given some json data with this 
shape:

{code:javascript}
{ "timestamp": "2015-11-03T07:21:24.066Z"}
{code}

This query fails:
{code}
select to_timestamp(`timestamp`, '-MM-dd''T''HH:mm:ss.SSS''Z''') from 
mydatasource;

Error: PARSE ERROR: Non-query expression encountered in illegal context

while parsing SQL query:
  select to_timestamp(`timestamp`, '-MM-dd''T''HH:mm:ss.SSS''Z''') from 
(seleect * from tvmetrix.raw limit 1)
{code}

And this one works:
{code}
select to_timestamp(`timestamp`, '-MM-dd''T''HH:mm:ss.SSS''Z''') from 
(select * from mydatasource); 
{code}

> Error happening without limit clause and works with limit clause
> 
>
> Key: DRILL-2669
> URL: https://issues.apache.org/jira/browse/DRILL-2669
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Functions - Drill
>Affects Versions: 0.8.0
> Environment: mapr sandbox 4.0.2
>Reporter: Sudhakar Thota
> Fix For: Future
>
>
> Perhaps this could be a bug. I get the same results.
> But the plan is very different, the UnionExchange is set up immediately after 
> the scan operation in successful case( Case 1 ), where as UnionExchange is 
> happening after scan>project (Case -2).
> Case -1.Successful case.
> {code}
> 0: jdbc:drill:> explain plan for select to_timestamp(t.t, 
> '-MM-dd''T''HH:mm:ss.SSS''Z''') FROM (select * from 
> dfs.sthota_prq.`/tstamp_test/*.parquet` limit 13015351) t;
> --+
> text  json
> --+
> 00-00 Screen
> 00-01 Project(EXPR$0=[TO_TIMESTAMP(ITEM($0, 't'), 
> '-MM-dd''T''HH:mm:ss.SSS''Z''')])
> 00-02 SelectionVectorRemover
> 00-03 Limit(fetch=[13015351])
> 00-04 UnionExchange
> 01-01 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath 
> [path=maprfs:/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test/1_2_0.parquet],
>  ReadEntryWithPath 
> [path=maprfs:/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test/1_1_0.parquet],
>  ReadEntryWithPath 
> [path=maprfs:/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test/1_0_0.parquet]],
>  selectionRoot=/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test, 
> numFiles=3, columns=[`*`]]])
> {
> "head" :
> Unknown macro: { "version" }
> ,
> {code}
> Case -2. Unsuccessful case:
> {code}
> 0: jdbc:drill:> explain plan for select to_timestamp(t.t, 
> '-MM-dd''T''HH:mm:ss.SSS''Z''') FROM (select * from 
> dfs.sthota_prq.`/tstamp_test/*.parquet` ) t;
> --+
> text  json
> --+
> 00-00 Screen
> 00-01 UnionExchange
> 01-01 Project(EXPR$0=[TO_TIMESTAMP(ITEM($0, 't'), 
> '-MM-dd''T''HH:mm:ss.SSS''Z''')])
> 01-02 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath 
> [path=maprfs:/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test/1_2_0.parquet],
>  ReadEntryWithPath 
> [path=maprfs:/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test/1_1_0.parquet],
>  ReadEntryWithPath 
> [path=maprfs:/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test/1_0_0.parquet]],
>  selectionRoot=/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test, 
> numFiles=3, columns=[`*`]]])
> {
> "head" :
> Unknown macro: { "version" }
> ,
> {code}
> {code}
> 0: jdbc:drill:> select to_timestamp(t.t, '-MM-dd''T''HH:mm:ss.SSS''Z''') 
> FROM (select * from dfs.sthota_prq.`/tstamp_test/*.parquet` limit 10) t;
> 
> EXPR$0
> 
> 2015-01-27 13:43:53.0
> 2015-01-27 13:43:49.0
> 2015-01-27 13:43:47.0
> 2015-01-27 13:43:47.0
> 2015-01-27 13:43:47.0
> 2015-01-27 13:43:45.0
> 2015-01-27 13:43:43.0
> 2015-01-27 13:43:43.0
> 2015-01-27 13:43:43.0
> 2015-01-27 13:43:39.0
> 
> 10 rows selected (1.127 seconds)
> {code}
> {code}
> 0: jdbc:drill:> select to_timestamp(t.t, '-MM-dd''T''HH:mm:ss.SSS''Z''') 
> FROM (select * from dfs.sthota_prq.`/tstamp_test/*.parquet`) t;
> {code}
> {code}
> 0: 

[jira] [Commented] (DRILL-2669) Error happening without limit clause and works with limit clause

2016-01-28 Thread Oscar Morante (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-2669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15121303#comment-15121303
 ] 

Oscar Morante commented on DRILL-2669:
--

Hi, I think I'm running into the same issue.  Given some json data with this 
shape:

{code:javascript}
{ "timestamp": "2015-11-03T07:21:24.066Z"}
{code}

This query fails:
{code}
select to_timestamp(`timestamp`, '-MM-dd''T''HH:mm:ss.SSS''Z''') from 
mydatasource;

Error: PARSE ERROR: Non-query expression encountered in illegal context

while parsing SQL query:
  select to_timestamp(`timestamp`, '-MM-dd''T''HH:mm:ss.SSS''Z''') from 
(seleect * from tvmetrix.raw limit 1)
{code}

And this one works:
{code}
select to_timestamp(`timestamp`, '-MM-dd''T''HH:mm:ss.SSS''Z''') from 
(select * from mydatasource); 
{code}

> Error happening without limit clause and works with limit clause
> 
>
> Key: DRILL-2669
> URL: https://issues.apache.org/jira/browse/DRILL-2669
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Functions - Drill
>Affects Versions: 0.8.0
> Environment: mapr sandbox 4.0.2
>Reporter: Sudhakar Thota
> Fix For: Future
>
>
> Perhaps this could be a bug. I get the same results.
> But the plan is very different, the UnionExchange is set up immediately after 
> the scan operation in successful case( Case 1 ), where as UnionExchange is 
> happening after scan>project (Case -2).
> Case -1.Successful case.
> {code}
> 0: jdbc:drill:> explain plan for select to_timestamp(t.t, 
> '-MM-dd''T''HH:mm:ss.SSS''Z''') FROM (select * from 
> dfs.sthota_prq.`/tstamp_test/*.parquet` limit 13015351) t;
> --+
> text  json
> --+
> 00-00 Screen
> 00-01 Project(EXPR$0=[TO_TIMESTAMP(ITEM($0, 't'), 
> '-MM-dd''T''HH:mm:ss.SSS''Z''')])
> 00-02 SelectionVectorRemover
> 00-03 Limit(fetch=[13015351])
> 00-04 UnionExchange
> 01-01 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath 
> [path=maprfs:/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test/1_2_0.parquet],
>  ReadEntryWithPath 
> [path=maprfs:/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test/1_1_0.parquet],
>  ReadEntryWithPath 
> [path=maprfs:/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test/1_0_0.parquet]],
>  selectionRoot=/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test, 
> numFiles=3, columns=[`*`]]])
> {
> "head" :
> Unknown macro: { "version" }
> ,
> {code}
> Case -2. Unsuccessful case:
> {code}
> 0: jdbc:drill:> explain plan for select to_timestamp(t.t, 
> '-MM-dd''T''HH:mm:ss.SSS''Z''') FROM (select * from 
> dfs.sthota_prq.`/tstamp_test/*.parquet` ) t;
> --+
> text  json
> --+
> 00-00 Screen
> 00-01 UnionExchange
> 01-01 Project(EXPR$0=[TO_TIMESTAMP(ITEM($0, 't'), 
> '-MM-dd''T''HH:mm:ss.SSS''Z''')])
> 01-02 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath 
> [path=maprfs:/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test/1_2_0.parquet],
>  ReadEntryWithPath 
> [path=maprfs:/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test/1_1_0.parquet],
>  ReadEntryWithPath 
> [path=maprfs:/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test/1_0_0.parquet]],
>  selectionRoot=/mapr/demo.mapr.com/user/sthota/parquet/tstamp_test, 
> numFiles=3, columns=[`*`]]])
> {
> "head" :
> Unknown macro: { "version" }
> ,
> {code}
> {code}
> 0: jdbc:drill:> select to_timestamp(t.t, '-MM-dd''T''HH:mm:ss.SSS''Z''') 
> FROM (select * from dfs.sthota_prq.`/tstamp_test/*.parquet` limit 10) t;
> 
> EXPR$0
> 
> 2015-01-27 13:43:53.0
> 2015-01-27 13:43:49.0
> 2015-01-27 13:43:47.0
> 2015-01-27 13:43:47.0
> 2015-01-27 13:43:47.0
> 2015-01-27 13:43:45.0
> 2015-01-27 13:43:43.0
> 2015-01-27 13:43:43.0
> 2015-01-27 13:43:43.0
> 2015-01-27 13:43:39.0
> 
> 10 rows selected (1.127 seconds)
> {code}
> {code}
> 0: jdbc:drill:> select to_timestamp(t.t, '-MM-dd''T''HH:mm:ss.SSS''Z''') 
> FROM (select * from dfs.sthota_prq.`/tstamp_test/*.parquet`) t;
> {code}
> {code}
> 0: jdbc:drill:> select to_timestamp(t.t, '-MM-dd''T''HH:mm:ss.SSS''Z''') 
> FROM (select * from dfs.sthota_prq.`/tstamp_test/*.parquet`) t;
> Query failed: RemoteRpcException: Failure while trying to start remote 
> fragment, Expression has syntax error! line 1:30:mismatched input 'T' 
> expecting CParen [ ab817e5a-9b74-47dd-b3c6-3bbf025c7de9 on maprdemo:31010 ]
> Error: exception while executing query: Failure while executing query. 
> (state=,code=0)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)