Return-Path: X-Original-To: apmail-phoenix-dev-archive@minotaur.apache.org Delivered-To: apmail-phoenix-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 495A511B1C for ; Fri, 2 May 2014 04:42:45 +0000 (UTC) Received: (qmail 24864 invoked by uid 500); 2 May 2014 04:42:44 -0000 Delivered-To: apmail-phoenix-dev-archive@phoenix.apache.org Received: (qmail 24838 invoked by uid 500); 2 May 2014 04:42:43 -0000 Mailing-List: contact dev-help@phoenix.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.incubator.apache.org Delivered-To: mailing list dev@phoenix.incubator.apache.org Received: (qmail 24797 invoked by uid 99); 2 May 2014 04:42:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 May 2014 04:42:43 +0000 X-ASF-Spam-Status: No, hits=-2000.7 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 02 May 2014 04:42:41 +0000 Received: (qmail 23616 invoked by uid 99); 2 May 2014 04:42:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 May 2014 04:42:20 +0000 Date: Fri, 2 May 2014 04:42:20 +0000 (UTC) From: "James Taylor (JIRA)" To: dev@phoenix.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (PHOENIX-809) Metadata is not getting updated for dynamically created columns MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/PHOENIX-809?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] James Taylor resolved PHOENIX-809. ---------------------------------- Resolution: Invalid WAD > Metadata is not getting updated for dynamically created columns > --------------------------------------------------------------- > > Key: PHOENIX-809 > URL: https://issues.apache.org/jira/browse/PHOENIX-809 > Project: Phoenix > Issue Type: Task > Reporter: alex kamil > > After creating columns dynamically with upsert, users need to keep track of the newly created metadata (column names/types) themselves, as the metadata for dynamically added columns is not retrievable via standard JDBC DatabaseMetaData calls. > for example: > create table with one column: > CREATE TABLE IF NOT EXISTS my_test_table (rowkey VARCHAR NOT NULL PRIMARY KEY) > add two more columns dynamically: > UPSERT INTO my_test_table (rowkey, col1 VARCHAR, col2 VARCHAR) VALUES ('rk', 'value1', 'value2'); > Now the only way to see the new column values is by defining column names/types every time at runtime: > select * from my_test_table (rowkey VARCHAR, col1 VARCHAR, col2 VARCHAR); > i.e. simple "select * from my_test_table;" would only show the values of the columns defined using stanard ddl (such as "rowkey" column defined in "create table" statment above, or "alter table"). The col1,col2 metadata is not accessible via DatabaseMetaData calls (such as getColumns). > While dynamically defined columns seem to go beyond standard SQL functionality , this is one of the key features of hbase/phoenix that makes it useful for us. > current workarounds are ugly - e.g either spawn a separate thread updating metadata via "ALTER TABLE" asynchronously (decoupled from the thread doing upserts) in order not to slow down the upserts; or use a local metadata cache which introduces consistency issues when syncing multiple phoenix clients. -- This message was sent by Atlassian JIRA (v6.2#6252)