You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Samarth Jain (JIRA)" <ji...@apache.org> on 2014/03/06 21:59:47 UTC

[jira] [Created] (PHOENIX-117) Creating a sequence with CACHE LONG.MAX_VALUE fails

Samarth Jain created PHOENIX-117:
------------------------------------

             Summary: Creating a sequence with CACHE LONG.MAX_VALUE fails
                 Key: PHOENIX-117
                 URL: https://issues.apache.org/jira/browse/PHOENIX-117
             Project: Phoenix
          Issue Type: Bug
    Affects Versions: 3.0.0
            Reporter: Samarth Jain


Statement:
CREATE SEQUENCE  ABC CACHE LONG.MAX_VALUE fails with the stacktrace:
{code}
java.sql.SQLException: ERROR 1204 (42Z04): Sequence CACHE value must be a non negative integer constant. tableName=06Qxx0000000007_SEQ
	at org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:308)
	at org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:133)
	at org.apache.phoenix.compile.CreateSequenceCompiler.compile(CreateSequenceCompiler.java:175)
	at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableCreateSequenceStatement.compilePlan(PhoenixStatement.java:469)
	at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableCreateSequenceStatement.compilePlan(PhoenixStatement.java:459)
	at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:224)
	at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:923)
{code}


Looking at the code - looks like the coercibility check in CreateSequenceCompiler needs to be changed 
to
cacheSizeExpr.getDataType().isCoercibleTo(PDataType.LONG) 



--
This message was sent by Atlassian JIRA
(v6.2#6252)