You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Maryann Xue (JIRA)" <ji...@apache.org> on 2014/02/19 23:15:22 UTC

[jira] [Created] (PHOENIX-61) Indexing on columns of Date/Timestamp type would lead to ArgumentTypeMismatchException in optimize()

Maryann Xue created PHOENIX-61:
----------------------------------

             Summary: 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


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)