You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Steven Phillips (JIRA)" <ji...@apache.org> on 2014/11/20 20:47:33 UTC

[jira] [Commented] (DRILL-1760) Count on a map fails with SchemaChangeException

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

Steven Phillips commented on DRILL-1760:
----------------------------------------

This seems pretty simple. We just need to implement a count function for maps.

> Count on a map fails with SchemaChangeException
> -----------------------------------------------
>
>                 Key: DRILL-1760
>                 URL: https://issues.apache.org/jira/browse/DRILL-1760
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Hanifi Gunes
>
> Take yelp business dataset and run
> {code:sql}
> select count(attributes) from dfs.`/path/to/yelp-business.json`
> {code}
> you should read
> {code:java}
> org.apache.drill.exec.exception.SchemaChangeException: Failure while materializing expression. 
> Error in expression at index -1.  Error: Missing function implementation: [count(MAP-REQUIRED)].  Full expression: --UNKNOWN EXPRESSION--.
> 	at org.apache.drill.exec.physical.impl.aggregate.StreamingAggBatch.createAggregatorInternal(StreamingAggBatch.java:221) [classes/:na]
> 	at org.apache.drill.exec.physical.impl.aggregate.StreamingAggBatch.createAggregator(StreamingAggBatch.java:173) [classes/:na]
> 	at org.apache.drill.exec.physical.impl.aggregate.StreamingAggBatch.buildSchema(StreamingAggBatch.java:89) [classes/:na]
> 	at org.apache.drill.exec.physical.impl.validate.IteratorValidatorBatchIterator.buildSchema(IteratorValidatorBatchIterator.java:80) [classes/:na]
> 	at org.apache.drill.exec.record.AbstractSingleRecordBatch.buildSchema(AbstractSingleRecordBatch.java:109) [classes/:na]
> 	at org.apache.drill.exec.physical.impl.validate.IteratorValidatorBatchIterator.buildSchema(IteratorValidatorBatchIterator.java:80) [classes/:na]
> 	at org.apache.drill.exec.physical.impl.svremover.RemovingRecordBatch.buildSchema(RemovingRecordBatch.java:64) [classes/:na]
> 	at org.apache.drill.exec.physical.impl.validate.IteratorValidatorBatchIterator.buildSchema(IteratorValidatorBatchIterator.java:80) [classes/:na]
> 	at org.apache.drill.exec.physical.impl.ScreenCreator$ScreenRoot.buildSchema(ScreenCreator.java:95) [classes/:na]
> 	at org.apache.drill.exec.work.fragment.FragmentExecutor.run(FragmentExecutor.java:111) [classes/:na]
> 	at org.apache.drill.exec.work.WorkManager$RunnableWrapper.run(WorkManager.java:249) [classes/:na]
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_65]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_65]
> 	at java.lang.Thread.run(Thread.java:745) [na:1.7.0_65]
> {code}
> I would expect to be able run count query on `attributes` field given that I can run a select on the same field.



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