You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2014/03/02 02:21:19 UTC
[jira] [Commented] (PHOENIX-61) Indexing on columns of
Date/Timestamp type would lead to ArgumentTypeMismatchException in
optimize()
[ https://issues.apache.org/jira/browse/PHOENIX-61?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13917250#comment-13917250 ]
James Taylor commented on PHOENIX-61:
-------------------------------------
[~maryannxue] Did you get a chance to try this and did my fix work? Can you add a unit test for it, please, if you haven't already?
> Indexing on columns of Date/Timestamp type would lead to ArgumentTypeMismatchException in optimize()
> ----------------------------------------------------------------------------------------------------
>
> Key: PHOENIX-61
> URL: https://issues.apache.org/jira/browse/PHOENIX-61
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 2.2.3
> Reporter: Maryann Xue
> Original Estimate: 72h
> Remaining Estimate: 72h
>
> Table:
> CREATE TABLE IF NOT EXISTS "Orders"
> ("OrderID" VARCHAR(10) NOT NULL PRIMARY KEY,
> "CustomerID" VARCHAR(10),
> "ItemID" VARCHAR(10),
> "Quantity" INTEGER,
> "Date" DATE);
> Index:
> CREATE INDEX IF NOT EXISTS "i2Orders" ON "Orders"
> ("Date")
> INCLUDE
> ("CustomerID", "ItemID", "Quantity");
> Query:
> SELECT "Date" FROM "Orders" ORDER BY "Date";
> Error Message:
> org.apache.phoenix.schema.ArgumentTypeMismatchException: ERROR 203 (22005): Type mismatch. expected: DATE but was: DECIMAL at column: Date
> at org.apache.phoenix.compile.ProjectionCompiler.compile(ProjectionCompiler.java:286)
> at org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.java:273)
> at org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:131)
> at org.apache.phoenix.optimize.QueryOptimizer.addPlan(QueryOptimizer.java:187)
> at org.apache.phoenix.optimize.QueryOptimizer.optimize(QueryOptimizer.java:113)
> at org.apache.phoenix.optimize.QueryOptimizer.optimize(QueryOptimizer.java:75)
> at org.apache.phoenix.optimize.QueryOptimizer.optimize(QueryOptimizer.java:69)
> at org.apache.phoenix.compile.JoinCompiler.optimize(JoinCompiler.java:1020)
> at org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:123)
> at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:262)
> at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:251)
> at org.apache.phoenix.jdbc.PhoenixPreparedStatement.getParameterMetaData(PhoenixPreparedStatement.java:205)
> at org.apache.phoenix.jdbc.PhoenixConnection.executeStatements(PhoenixConnection.java:172)
> at org.apache.phoenix.util.PhoenixRuntime.executeStatements(PhoenixRuntime.java:248)
> at org.apache.phoenix.util.PhoenixRuntime.main(PhoenixRuntime.java:195)
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)