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

ASF GitHub Bot commented on DRILL-4264:
---------------------------------------

Github user vvysotskyi commented on a diff in the pull request:

    https://github.com/apache/drill/pull/909#discussion_r134689741
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectRecordBatch.java
 ---
    @@ -362,16 +363,16 @@ protected boolean setupNewSchema() throws 
SchemaChangeException {
                   final TransferPair tp = vvIn.makeTransferPair(vvOut);
                   transfers.add(tp);
                 }
    -          } else if (value != null && value.intValue() > 1) { // 
subsequent wildcards should do a copy of incoming valuevectors
    +          } else if (value != null && value > 1) { // subsequent wildcards 
should do a copy of incoming valuevectors
                 int k = 0;
                 for (final VectorWrapper<?> wrapper : incoming) {
                   final ValueVector vvIn = wrapper.getValueVector();
    -              final SchemaPath originalPath = 
SchemaPath.getSimplePath(vvIn.getField().getPath());
    -              if (k > result.outputNames.size()-1) {
    +              final SchemaPath originalPath = 
SchemaPath.getSimplePath(vvIn.getField().getName());
    +              if (k > result.outputNames.size() - 1) {
                     assert false;
                   }
                   final String name = result.outputNames.get(k++);  // get the 
renamed column names
    -              if (name == EMPTY_STRING) {
    +              if (EMPTY_STRING.equals(name)) {
    --- End diff --
    
    Thanks, replaced by `name.isEmpty()`, but `EMPTY_STRING` is used in other 
places, so left it in the class.


> Allow field names to include dots
> ---------------------------------
>
>                 Key: DRILL-4264
>                 URL: https://issues.apache.org/jira/browse/DRILL-4264
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Execution - Codegen
>            Reporter: Alex
>            Assignee: Volodymyr Vysotskyi
>              Labels: doc-impacting
>             Fix For: 1.12.0
>
>
> If you have some json data like this...
> {code:javascript}
>     {
>       "0.0.1":{
>         "version":"0.0.1",
>         "date_created":"2014-03-15"
>       },
>       "0.1.2":{
>         "version":"0.1.2",
>         "date_created":"2014-05-21"
>       }
>     }
> {code}
> ... there is no way to select any of the rows since their identifiers contain 
> dots and when trying to select them, Drill throws the following error:
> Error: SYSTEM ERROR: UnsupportedOperationException: Unhandled field reference 
> "0.0.1"; a field reference identifier must not have the form of a qualified 
> name
> This must be fixed since there are many json data files containing dots in 
> some of the keys (e.g. when specifying version numbers etc)



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to