drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Altekruse (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-2440) Single value date functions do not work
Date Thu, 12 Mar 2015 20:37:39 GMT

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

Jason Altekruse commented on DRILL-2440:
----------------------------------------

This looks like an issue with JSON extended types. Drill can internally represent dates, but
we might not support mapping Mongo date types into Drill. As far as I know, the Mongo reader
just considers the records to be standard JSON.

The map that is returned in your first query is what Mongo stores to denote a date (rather
than data that looks like a date within a plain json string).

If you look at the Drill error you will see it could not find a extractMonth function for
type Map. We need to interpret this kind of map into a date type when reading mongo.

I don't understand why this is working for [~kam_iitkgp], are you possibly using different
versions of Drill or Mongo, do you have extended type support set up differently? It looks
like there are two mode described in the page linked below, one might be better suited for
Drill, as we have implicit cast rules set up that may allow you to read plain strings and
gracefully pass them into date functions.

http://docs.mongodb.org/manual/reference/mongodb-extended-json/ 

> Single value date functions do not work
> ---------------------------------------
>
>                 Key: DRILL-2440
>                 URL: https://issues.apache.org/jira/browse/DRILL-2440
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 0.7.0
>         Environment: Windows embeded mode. MongoDB plugin
>            Reporter: Filip Grabowski
>
> I configured Apache drill and connected to Mongo and created some nice queries.
> This is a query that works fine - just a proof that the environment is configured.
> SELECT interactionDateTime FROM interactionrecord limit 5;
> { "$date" : "2015-03-05T00:08:10.753Z"}
> { "$date" : "2015-03-05T00:08:10.794Z"}
> { "$date" : "2015-03-05T00:08:10.803Z"}
> { "$date" : "2015-03-05T00:08:35.180Z"}
> { "$date" : "2015-03-05T00:08:35.180Z"}
> This simple query fails regardless of upper or lower case of function name. Similarly
fail other queries that use other data time functions. This one seemed the simplest...
> SELECT CURRENT_DATE FROM interactionrecord limit 5;
> Query failed to execute. Execute Query failed. 
> Error type: Odbc error. Odbc operation attempted: SQLExecDirect. [S1000:1040: on HSTMT]
[MapR][Drill] (1040) Drill failed to execute the query: SELECT CURRENT_DATE FROM interactionrecord
limit 5
> [30024]Query execution error. Details:[ 
> Query stopped., Failure while trying to materialize incoming schema. Errors:
> Error in expression at index -1. Error: Missing function implementation: [extractDay(MAP-REQUIRED)].
Full expression: --UNKNOWN EXPRESSION--.. [ 714416ec-e841-4443-8d70-bbb351547ddd on Window764bi-0:31010
]
> ]



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

Mime
View raw message