phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-2757) Phoenix Can't Coerce String to Boolean
Date Wed, 09 Mar 2016 23:21:40 GMT

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

ASF GitHub Bot commented on PHOENIX-2757:
-----------------------------------------

GitHub user aaronst opened a pull request:

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

    PHOENIX-2757 Phoenix Can't Coerce String to Boolean

    

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

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

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

    https://github.com/apache/phoenix/pull/152.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 #152
    
----
commit 0be01f3dc6f0f5a62b9b0b5be916e3196c9bebf0
Author: aaronst <aaron@icebrg.io>
Date:   2016-03-09T23:19:49Z

    PHOENIX-2757 Phoenix Can't Coerce String to Boolean

----


> Phoenix Can't Coerce String to Boolean
> --------------------------------------
>
>                 Key: PHOENIX-2757
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2757
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.6.0
>            Reporter: Aaron Stephens
>
> In the process of trying to UPSERT rows with Phoenix via Nifi, I've run into the following:
> {noformat}
> org.apache.phoenix.schema.ConstraintViolationException: org.apache.phoenix.schema.TypeMismatchException:
ERROR 203 (22005): Type mismatch. VARCHAR cannot be coerced to BOOLEAN
>         at org.apache.phoenix.schema.types.PDataType.throwConstraintViolationException(PDataType.java:282)
~[na:na]
>         at org.apache.phoenix.schema.types.PBoolean.toObject(PBoolean.java:136) ~[na:na]
>         at org.apache.phoenix.jdbc.PhoenixPreparedStatement.setObject(PhoenixPreparedStatement.java:442)
~[na:na]
>         at org.apache.commons.dbcp.DelegatingPreparedStatement.setObject(DelegatingPreparedStatement.java:166)
~[na:na]
>         at org.apache.commons.dbcp.DelegatingPreparedStatement.setObject(DelegatingPreparedStatement.java:166)
~[na:na]
>         at org.apache.nifi.processors.standard.PutSQL.setParameter(PutSQL.java:728) ~[na:na]
>         at org.apache.nifi.processors.standard.PutSQL.setParameters(PutSQL.java:606)
~[na:na]
>         at org.apache.nifi.processors.standard.PutSQL.onTrigger(PutSQL.java:223) ~[na:na]
>         at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
~[nifi-api-0.4.1.jar:0.4.1]
>         at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1146)
~[nifi-framework-core-0.4.1.jar:0.4.1]
>         at org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:139)
[nifi-framework-core-0.4.1.jar:0.4.1]
>         at org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:49)
[nifi-framework-core-0.4.1.jar:0.4.1]
>         at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:119)
[nifi-framework-core-0.4.1.jar:0.4.1]
>         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_79]
>         at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304) [na:1.7.0_79]
>         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
[na:1.7.0_79]
>         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
[na:1.7.0_79]
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[na:1.7.0_79]
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[na:1.7.0_79]
>         at java.lang.Thread.run(Thread.java:745) [na:1.7.0_79]
> Caused by: org.apache.phoenix.schema.TypeMismatchException: ERROR 203 (22005): Type mismatch.
VARCHAR cannot be coerced to BOOLEAN
>         at org.apache.phoenix.exception.SQLExceptionCode$1.newException(SQLExceptionCode.java:71)
~[na:na]
>         at org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:145)
~[na:na]
>         ... 20 common frames omitted
> {noformat}
> It appears that Phoenix currently does not know how to coerce a String into a Boolean
(see [here|https://github.com/apache/phoenix/blob/master/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PBoolean.java#L124-L137]).
 This is a feature that's present in other drivers such as PostgreSQL.



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

Mime
View raw message