Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id DD919200D08 for ; Thu, 21 Sep 2017 17:15:06 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id DC2861609E4; Thu, 21 Sep 2017 15:15:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0560D1609B8 for ; Thu, 21 Sep 2017 17:15:05 +0200 (CEST) Received: (qmail 12009 invoked by uid 500); 21 Sep 2017 15:15:05 -0000 Mailing-List: contact dev-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list dev@phoenix.apache.org Received: (qmail 11993 invoked by uid 99); 21 Sep 2017 15:15:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Sep 2017 15:15:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 9FB9C1A476E for ; Thu, 21 Sep 2017 15:15:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id W0g2H7uSJrRH for ; Thu, 21 Sep 2017 15:15:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 4BDBA5F3FE for ; Thu, 21 Sep 2017 15:15:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 7CA7BE0288 for ; Thu, 21 Sep 2017 15:15:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 3386A2140D for ; Thu, 21 Sep 2017 15:15:00 +0000 (UTC) Date: Thu, 21 Sep 2017 15:15:00 +0000 (UTC) From: "Josh Elser (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (PHOENIX-4222) PhoenixStorageHandler for Hive is not working MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 21 Sep 2017 15:15:07 -0000 [ https://issues.apache.org/jira/browse/PHOENIX-4222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16174912#comment-16174912 ] Josh Elser commented on PHOENIX-4222: ------------------------------------- The quoting was added in PHOENIX-3346 to better handle the column mapping feature of the integration. Seems like we might need a case to omit the quotation marks when a column mapping isn't provided? Or perhaps toUpperCase() the column name if the same? > PhoenixStorageHandler for Hive is not working > --------------------------------------------- > > Key: PHOENIX-4222 > URL: https://issues.apache.org/jira/browse/PHOENIX-4222 > Project: Phoenix > Issue Type: Bug > Affects Versions: 4.11.0 > Reporter: JeongMin Ju > Labels: hive > Attachments: PhoenixQueryBuilder-buildExpressionStringFrom.jpeg, PhoenixQueryBuilder-getSelectColumns.jpeg > > > {panel} > ERROR CliDriver: Failed with exception java.io.IOException:java.lang.RuntimeException: org.apache.phoenix.schema.ColumnNotFoundException: ERROR 504 (42703): Undefined column. columnName=PHOENIX.MOVIES.movie_id > java.io.IOException: java.lang.RuntimeException: org.apache.phoenix.schema.ColumnNotFoundException: ERROR 504 (42703): Undefined column. columnName=PHOENIX.MOVIES.movie_id > at org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow(FetchOperator.java:508) > at org.apache.hadoop.hive.ql.exec.FetchOperator.pushRow(FetchOperator.java:415) > at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:138) > at org.apache.hadoop.hive.ql.Driver.getResults(Driver.java:1986) > at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:240) > at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:172) > at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:383) > at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:775) > at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:693) > at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:628) > Caused by: java.lang.RuntimeException: org.apache.phoenix.schema.ColumnNotFoundException: ERROR 504 (42703): Undefined column. columnName=PHOENIX.MOVIES.movie_id > at org.apache.phoenix.hive.mapreduce.PhoenixInputFormat.getQueryPlan(PhoenixInputFormat.java:266) > at org.apache.phoenix.hive.mapreduce.PhoenixInputFormat.getSplits(PhoenixInputFormat.java:131) > at org.apache.hadoop.hive.ql.exec.FetchOperator.getNextSplits(FetchOperator.java:363) > at org.apache.hadoop.hive.ql.exec.FetchOperator.getRecordReader(FetchOperator.java:295) > at org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow(FetchOperator.java:446) > ... 9 more > Caused by: org.apache.phoenix.schema.ColumnNotFoundException: ERROR 504 (42703): Undefined column. columnName=PHOENIX.MOVIES.movie_id > at org.apache.phoenix.schema.PTableImpl.getColumnForColumnName(PTableImpl.java:818) > at org.apache.phoenix.compile.FromCompiler$SingleTableColumnResolver.resolveColumn(FromCompiler.java:478) > at org.apache.phoenix.compile.TupleProjectionCompiler$ColumnRefVisitor.visit(TupleProjectionCompiler.java:208) > at org.apache.phoenix.compile.TupleProjectionCompiler$ColumnRefVisitor.visit(TupleProjectionCompiler.java:1) > at org.apache.phoenix.parse.ColumnParseNode.accept(ColumnParseNode.java:56) > at org.apache.phoenix.compile.TupleProjectionCompiler.createProjectedTable(TupleProjectionCompiler.java:109) > at org.apache.phoenix.compile.QueryCompiler.compileSingleFlatQuery(QueryCompiler.java:528) > at org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.java:507) > at org.apache.phoenix.compile.QueryCompiler.compileSelect(QueryCompiler.java:202) > at org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:157) > at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:475) > at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:1) > at org.apache.phoenix.jdbc.PhoenixStatement.compileQuery(PhoenixStatement.java:1648) > at org.apache.phoenix.jdbc.PhoenixStatement.compileQuery(PhoenixStatement.java:1641) > at org.apache.phoenix.jdbc.PhoenixStatement.optimizeQuery(PhoenixStatement.java:1635) > at org.apache.phoenix.hive.mapreduce.PhoenixInputFormat.getQueryPlan(PhoenixInputFormat.java:260) > ... 13 more > {panel} > {noformat} > : jdbc:phoenix:juke-cdh2> !columns phoenix.movies > +------------+--------------+-------------+--------------+------------+------------+--------------+----------------+-----------------+-----------------+-----------+----------+-------------+ > | TABLE_CAT | TABLE_SCHEM | TABLE_NAME | COLUMN_NAME | DATA_TYPE | TYPE_NAME | COLUMN_SIZE | BUFFER_LENGTH | DECIMAL_DIGITS | NUM_PREC_RADIX | NULLABLE | REMARKS | COLUMN_DEF | > +------------+--------------+-------------+--------------+------------+------------+--------------+----------------+-----------------+-----------------+-----------+----------+-------------+ > | | PHOENIX | MOVIES | MOVIE_ID | 4 | INTEGER | null | null | null | null | 0 | | | > | | PHOENIX | MOVIES | TITLE | 12 | VARCHAR | null | null | null | null | 1 | | | > | | PHOENIX | MOVIES | GENRES | 12 | VARCHAR | null | null | null | null | 1 | | | > +------------+--------------+-------------+--------------+------------+------------+--------------+----------------+-----------------+-----------------+-----------+----------+-------------+ > {noformat} > {noformat} > hive> show create table movies; > CREATE EXTERNAL TABLE `movies`( > `movie_id` int COMMENT 'from deserializer', > `title` string COMMENT 'from deserializer', > `genres` string COMMENT 'from deserializer') > ROW FORMAT SERDE > 'org.apache.phoenix.hive.PhoenixSerDe' > STORED BY > 'org.apache.phoenix.hive.PhoenixStorageHandler' > WITH SERDEPROPERTIES ( > 'serialization.format'='1') > LOCATION > 'hdfs://nameservice1/user/hive/warehouse/movies' > TBLPROPERTIES ( > 'COLUMN_STATS_ACCURATE'='false', > 'numFiles'='0', > 'numRows'='-1', > 'phoenix.table.name'='phoenix.movies', > 'phoenix.zookeeper.quorum'='xxx', > 'rawDataSize'='-1', > 'totalSize'='0', > 'transient_lastDdlTime'='1503021635') > {noformat} > I ran the query "select * from movies" and > The query created by the phoenix handler is: > select /*+ NO_CACHE */ "movie_id","title","genres" from phoenix.movies > But do not enter double quotes like this. > I looked up where to put double quotes. > !https://issues.apache.org/jira/secure/attachment/12888228/PhoenixQueryBuilder-getSelectColumns.jpeg! > !https://issues.apache.org/jira/secure/attachment/12888229/PhoenixQueryBuilder-buildExpressionStringFrom.jpeg! > Why did you change it to double quotes? -- This message was sent by Atlassian JIRA (v6.4.14#64029)