[jira] [Commented] (PHOENIX-3267) Replace use of SELECT null with CAST(null AS )

2016-10-27 Thread Hudson (JIRA)

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

Hudson commented on PHOENIX-3267:
-

SUCCESS: Integrated in Jenkins build Phoenix-master #1455 (See 
[https://builds.apache.org/job/Phoenix-master/1455/])
PHOENIX-3267 Replace use of SELECT null with CAST(null AS ) (Eric 
(jamestaylor: rev 9eab8f584ca5e4c8db587e3326289f279d530b7b)
* (edit) 
phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixResultSetMetadataTest.java
* (edit) 
phoenix-core/src/it/java/org/apache/phoenix/end2end/AggregateQueryIT.java
* (edit) phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
* (edit) 
phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java


> Replace use of SELECT null with CAST(null AS )
> 
>
> Key: PHOENIX-3267
> URL: https://issues.apache.org/jira/browse/PHOENIX-3267
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: James Taylor
>Assignee: Eric Lomore
>Priority: Minor
>  Labels: calcite-compat-change
> Fix For: 4.9.0
>
>
> It appears that Calcite doesn't allow null as a SELECT expression. If this is 
> difficult to change, we can change our tests to cast null to a given data 
> type instead, like this: {{CAST(null AS VARCHAR)}}



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


[jira] [Commented] (PHOENIX-3267) Replace use of SELECT null with CAST(null AS )

2016-10-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on PHOENIX-3267:
-

Github user lomoree closed the pull request at:

https://github.com/apache/phoenix/pull/219


> Replace use of SELECT null with CAST(null AS )
> 
>
> Key: PHOENIX-3267
> URL: https://issues.apache.org/jira/browse/PHOENIX-3267
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: James Taylor
>Assignee: Eric Lomore
>Priority: Minor
>  Labels: calcite-compat-change
> Fix For: 4.9.0
>
>
> It appears that Calcite doesn't allow null as a SELECT expression. If this is 
> difficult to change, we can change our tests to cast null to a given data 
> type instead, like this: {{CAST(null AS VARCHAR)}}



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


[jira] [Commented] (PHOENIX-3267) Replace use of SELECT null with CAST(null AS )

2016-10-24 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on PHOENIX-3267:
-

GitHub user lomoree opened a pull request:

https://github.com/apache/phoenix/pull/219

PHOENIX-3267 Replace use of SELECT null with CAST(null AS )



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/bloomberg/phoenix master

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/phoenix/pull/219.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #219


commit d8aaa60bd49aa0fc29d5f4e97288199f18d56b1b
Author: Eric Lomore 
Date:   2016-10-25T00:04:40Z

PHOENIX-3267 Replace use of SELECT null with CAST(null AS )




> Replace use of SELECT null with CAST(null AS )
> 
>
> Key: PHOENIX-3267
> URL: https://issues.apache.org/jira/browse/PHOENIX-3267
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: James Taylor
>Assignee: Eric Lomore
>
> It appears that Calcite doesn't allow null as a SELECT expression. If this is 
> difficult to change, we can change our tests to cast null to a given data 
> type instead, like this: {{CAST(null AS VARCHAR)}}



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


[jira] [Commented] (PHOENIX-3267) Replace use of SELECT null with CAST(null AS )

2016-10-24 Thread James Taylor (JIRA)

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

James Taylor commented on PHOENIX-3267:
---

Yes, that'd be great. Thanks, [~lomoree].

> Replace use of SELECT null with CAST(null AS )
> 
>
> Key: PHOENIX-3267
> URL: https://issues.apache.org/jira/browse/PHOENIX-3267
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: James Taylor
>Assignee: Eric Lomore
>
> It appears that Calcite doesn't allow null as a SELECT expression. If this is 
> difficult to change, we can change our tests to cast null to a given data 
> type instead, like this: {{CAST(null AS VARCHAR)}}



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


[jira] [Commented] (PHOENIX-3267) Replace use of SELECT null with CAST(null AS )

2016-10-24 Thread Eric Lomore (JIRA)

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

Eric Lomore commented on PHOENIX-3267:
--

Did a scan over the files [~jamestaylor], and I found about 5 that look similar 
to this (null is one of the items under SELECT).

{code} conn.createStatement().executeQuery("SELECT pk1, pk2, v1, v2, NULL FROM 
T"); {code}

Should I create a quick pr with all of these cases?


> Replace use of SELECT null with CAST(null AS )
> 
>
> Key: PHOENIX-3267
> URL: https://issues.apache.org/jira/browse/PHOENIX-3267
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: James Taylor
>Assignee: Eric Lomore
>
> It appears that Calcite doesn't allow null as a SELECT expression. If this is 
> difficult to change, we can change our tests to cast null to a given data 
> type instead, like this: {{CAST(null AS VARCHAR)}}



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


[jira] [Commented] (PHOENIX-3267) Replace use of SELECT null with CAST(null AS )

2016-10-21 Thread Julian Hyde (JIRA)

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

Julian Hyde commented on PHOENIX-3267:
--

It would be possible to change Calcite to handle this, but it would take effort 
(of course) and would be non-standard (so would be only enabled with certain 
compliance settings). I suspect that several mainstream databases do allow 
'select null' but I'd have to check. I suspect that they have a special type 
'nulltype' (better than what Phoenix does, which is to use a null pointer 
instead of a type).

> Replace use of SELECT null with CAST(null AS )
> 
>
> Key: PHOENIX-3267
> URL: https://issues.apache.org/jira/browse/PHOENIX-3267
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: James Taylor
>Assignee: Eric Lomore
>
> It appears that Calcite doesn't allow null as a SELECT expression. If this is 
> difficult to change, we can change our tests to cast null to a given data 
> type instead, like this: {{CAST(null AS VARCHAR)}}



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


[jira] [Commented] (PHOENIX-3267) Replace use of SELECT null with CAST(null AS )

2016-10-20 Thread James Taylor (JIRA)

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

James Taylor commented on PHOENIX-3267:
---

Good first step would be to find out how other databases handle a statement 
like this:
{code}
SELECT null FROM my_table;
{code}
Phoenix currently handles this by having the type of the expression as null. 
This was a bit of a pain as it forced us to put a bunch of null checks in, but 
that's how it works currently.

So two possible solutions:
- Change the Phoenix test cases to cast null in these cases. The challenge 
would to find all the test cases that do this. I've looked and I'm not finding 
any, so maybe add one to QueryMetaDataTest. I do see in 
ModulusExpressionIT.testNullEverything() that we use null in the select clause, 
but that case is slightly different because we can infer the type based on it's 
context (though not the exact type):
{code}
SELECT null % my_col FROM my_table
{code}
- Change Calcite to handle this. Not sure if this is feasible, but I suspect 
[~julianhyde] would have an idea.

> Replace use of SELECT null with CAST(null AS )
> 
>
> Key: PHOENIX-3267
> URL: https://issues.apache.org/jira/browse/PHOENIX-3267
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: James Taylor
>Assignee: Eric Lomore
>
> It appears that Calcite doesn't allow null as a SELECT expression. If this is 
> difficult to change, we can change our tests to cast null to a given data 
> type instead, like this: {{CAST(null AS VARCHAR)}}



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