You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Sean Hsuan-Yi Chu (JIRA)" <ji...@apache.org> on 2015/01/15 10:35:35 UTC

[jira] [Commented] (DRILL-1876) Remove || (concatenation operator) from documentation

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

Sean Hsuan-Yi Chu commented on DRILL-1876:
------------------------------------------

"||" concat will be supported soon (after Drill-1877 patch is committed). 

However, there is another bug making "||" less ideal (Drill-2008). 

If users insist on using pipe, they have to first explicitly cast field as varchar, such as below:

select cast(a as varchar) || cast(b as varchar) from ...

> Remove || (concatenation operator) from documentation
> -----------------------------------------------------
>
>                 Key: DRILL-1876
>                 URL: https://issues.apache.org/jira/browse/DRILL-1876
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 0.7.0
>            Reporter: Victoria Markman
>            Assignee: Bridget Bevens
>             Fix For: 0.8.0
>
>
> It is documented, but it does not work at all (DRILL-779) 
> Workaround exists: concat function
> As of version 0.7.0 (git.commit.id.abbrev=3b0ff5d)
> (1)
> 0: jdbc:drill:schema=dfs> select 'abc' || 'def' from cp.`tpch/nation.parquet`;
> Query failed: Query failed: Failure while running fragment.[ dc4727ed-4ac3-42bb-a60b-f8f370dd4fcf on atsqa4-133.qa.lab:31010 ]
> [ dc4727ed-4ac3-42bb-a60b-f8f370dd4fcf on atsqa4-133.qa.lab:31010 ]
> Error: exception while executing query: Failure while executing query. (state=,code=0)
> (2)
> 0: jdbc:drill:schema=dfs> select n_name || 'xyz' from cp.`tpch/nation.parquet`;
> Query failed: Query failed: Unexpected exception during fragment initialization: Internal error: pre-condition failed: SqlTypeUtil.sameNamedType(argTypes[0], argTypes[1])
> Error: exception while executing query: Failure while executing query. (state=,code=0)
> (3)
> 0: jdbc:drill:schema=dfs> select cast(n_nationkey as varchar(10)) || n_name from cp.`tpch/nation.parquet`;
> Query failed: Query failed: Unexpected exception during fragment initialization: Internal error: pre-condition failed: SqlTypeUtil.sameNamedType(argTypes[0], argTypes[1])
> Error: exception while executing query: Failure while executing query. (state=,code=0)
> (4)
> 0: jdbc:drill:schema=dfs> select 'abc' || 'cde' from `test.json`;
> Query failed: Query failed: Failure while running fragment.[ 01194cdf-746c-45db-ae4e-014590bfbffd on atsqa4-133.qa.lab:31010 ]
> [ 01194cdf-746c-45db-ae4e-014590bfbffd on atsqa4-133.qa.lab:31010 ]
> Error: exception while executing query: Failure while executing query. (state=,code=0)



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