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 D30F2200D2E for ; Tue, 31 Oct 2017 11:41:19 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D1A1C160BF9; Tue, 31 Oct 2017 10:41:19 +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 EEC591609EB for ; Tue, 31 Oct 2017 11:41:18 +0100 (CET) Received: (qmail 74274 invoked by uid 500); 31 Oct 2017 10:41:18 -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 74262 invoked by uid 99); 31 Oct 2017 10:41:17 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Oct 2017 10:41:17 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 0B3CDD0EFD for ; Tue, 31 Oct 2017 10:41:17 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.791 X-Spam-Level: *** X-Spam-Status: No, score=3.791 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=2, HTML_OBFUSCATE_10_20=1.162, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 3bGcyTNf5ebj for ; Tue, 31 Oct 2017 10:41:16 +0000 (UTC) Received: from mail-yw0-f176.google.com (mail-yw0-f176.google.com [209.85.161.176]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id A9C3C5FD72 for ; Tue, 31 Oct 2017 10:41:15 +0000 (UTC) Received: by mail-yw0-f176.google.com with SMTP id t11so14270082ywg.12 for ; Tue, 31 Oct 2017 03:41:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=K/Pd+yVw+Sz7aRi5cgZUbzqOZNuvv3AvKec+r+7OXLc=; b=eP1GlIuddtDa87Mlnucj2EAOw9aBj5XgxfZp7cEHk8UwJ6wJfllP2ts5RMI3188/Co ScHpRvL5Dt/Hk62Nf5cxvJnF9CfN/RFWNu2zCBfPQxZV+vVEFlwzMJs983I9jtjlsBpj yxa/hM4P4fGeQipZYVVjSbvA6m01MvXI+v3JQe/cjuydsCvpo3NOJNdpBZ07gegXtVL3 j57Ks4Tbl+GABxPRHT4DEYZ5MhpGV4NvnlRVpdbKVho5kg5KXLaEnHkHXisKpF1ROl6E RMTmTmndBqqXxIR5R3M1anEpKnrLm8qZz9khkDHri7i8AwyZmX4ZF9bRJhMteJxXEsH3 BD8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=K/Pd+yVw+Sz7aRi5cgZUbzqOZNuvv3AvKec+r+7OXLc=; b=hjhTqtmT1vAJpd8FEEB3LyyMzFXfwoJX6zyU30GX6NC/z60PN9bHAlMs6OgSB51WBj P117pxiEV+QHEdoafPYWJPn7TukXmWLO2VGA6TpugqKJqFsdMLlUTU9vXEl53zck5Z9R Mx4+JFoWTxV0pNQ6gWKaDaAL3107AcbOL7dPU01BZc7sxe7YVzCWAW5nL6zRXOliLlpx Bs6P48mwC6TiyJG6Ul47loipiwZti3bp4lZ+X/KWSSF2U96g9vz/71AtBw50YH75wM5K OqpQQeLXHZsn22dvRB/yZS4EkwZKt2btWawDYBo+r4nlyZ/29lgYOKPvramrLMEkfO11 v+vA== X-Gm-Message-State: AMCzsaXHBYlRMJ4lqiq6lcgGKioChDG9wEh43GGofgUswxTm7vqjNC0s D0CTLqqdiVdKzjZ1Ju+05HKNAeuKPeH9XzsQmLk8eA== X-Google-Smtp-Source: ABhQp+QoBlAgAKGS2rstLIvOGmdP7rMWxFv4qZDPAVRUYytZ5ZsllLDflwm+Lp8rLZTxDjBjjuhezU7fpPZKBxpfhaU= X-Received: by 10.129.5.14 with SMTP id 14mr821867ywf.463.1509446474784; Tue, 31 Oct 2017 03:41:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.130.11 with HTTP; Tue, 31 Oct 2017 03:41:14 -0700 (PDT) In-Reply-To: References: From: Ankit Singhal Date: Tue, 31 Oct 2017 16:11:14 +0530 Message-ID: Subject: Re: [jira] [Commented] (PHOENIX-4234) Unable to find failed csv records in phoenix logs To: dev@phoenix.apache.org Content-Type: multipart/alternative; boundary="001a11417468efe5a7055cd56404" archived-at: Tue, 31 Oct 2017 10:41:20 -0000 --001a11417468efe5a7055cd56404 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Suprita, I still appreciate you asking questions on user@phoenix.apache.org so that whoever is better acquainted with the related code of the problem, can answer it at his earliest. We don't have any construct to alter the data type of the column as it will involve re-writing the data again. https://phoenix.apache.org/language/index.html#alter One way is to add a new column and run UPSERT SELECT to copy data from old column to new column and point your application to use the new column. OR, As VARCHAR limit is a soft limit and doesn't affect the data structure internally, you may try updating it in meta table by running below query(*b= ut use this hack with proper testing and at your own risk*) UPSERT INTO SYSTEM.CATALOG(TENANT_ID,TABLE_SCHEM,TABLE_NAME,COLUMN_NAME,COLUMN_FAMILY,C= OLUMN_SIZE) SELECT TENANT_ID,TABLE_SCHEM,TABLE_NAME,COLUMN_NAME,COLUMN_FAMILY,*15* as COLUMN_SIZE from system.catalog where TABLE_NAME=3D'G1V3IN_ADITI' and TABLE_SCHEM is NULL and COLUMN_NAME=3D'INVOICE' and COLUMN_FAMILY=3D'SBNUM'= ; Note:- you may need to restart the region servers and the clients to refresh the cache holding metadata. Regards, Ankit Singhal On Mon, Oct 30, 2017 at 12:39 PM, suprita (JIRA) wrote: > > [ https://issues.apache.org/jira/browse/PHOENIX-4234?page=3Dcom. > atlassian.jira.plugin.system.issuetabpanels:comment-tabpane > l&focusedCommentId=3D16224439#comment-16224439 ] > > suprita commented on PHOENIX-4234: > ---------------------------------- > > Hi Ankit, > > Once I Got a response from you regarding phoenix. > > Actually I want a quick response ,so posting you my query personally if > you could answer this along with posting on Jira group to get immediate > response if possible for you. > > My doubt is described below: > > I am using apache phoenix to create table and then dump csv data into > table. > But now I want to alter one colomn=E2=80=99s datatype length from varchar= (7) to > varchar(14),without losing the existing data into table. > > Can it be done? > If yes how? > > I tried the command to address the above mentioned issue but > ALTER TABLE G1V3IN_ADITI ALTER "INVOICE"."SBNUM" set data type > varchar(15), column "INVOICE"."SBNUM" drop default; > > Where sbnum is the colomn whose existing datatype length is 7 but we want > to change it to 15. > G1V3IN_ADITI is table name. > > But facing the below error: > Error: ERROR 601 (42P00): Syntax error. Encountered "ALTER" at line 1, > column 26. (state=3D42P00,code=3D601) > org.apache.phoenix.exception.PhoenixParserException: ERROR 601 (42P00): > Syntax error. Encountered "ALTER" at line 1, column 26. > at org.apache.phoenix.exception.PhoenixParserException.newExcep > tion(PhoenixParserException.java:33) > at org.apache.phoenix.parse.SQLParser.parseStatement(SQLParser. > java:111) > at org.apache.phoenix.jdbc.PhoenixStatement$PhoenixStatementPar > ser.parseStatement(PhoenixStatement.java:1283) > at org.apache.phoenix.jdbc.PhoenixStatement.parseStatement(Phoe > nixStatement.java:1364) > at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStat > ement.java:1427) > at sqlline.Commands.execute(Commands.java:822) > at sqlline.Commands.sql(Commands.java:732) > at sqlline.SqlLine.dispatch(SqlLine.java:808) > at sqlline.SqlLine.begin(SqlLine.java:681) > at sqlline.SqlLine.start(SqlLine.java:398) > at sqlline.SqlLine.main(SqlLine.java:292) > Caused by: NoViableAltException(7@[]) > at org.apache.phoenix.parse.PhoenixSQLParser.from_table_name( > PhoenixSQLParser.java:9081) > at org.apache.phoenix.parse.PhoenixSQLParser.alter_table_node( > PhoenixSQLParser.java:3229) > at org.apache.phoenix.parse.PhoenixSQLParser.oneStatement(Phoen > ixSQLParser.java:846) > at org.apache.phoenix.parse.PhoenixSQLParser.statement(PhoenixS > QLParser.java:499) > at org.apache.phoenix.parse.SQLParser.parseStatement(SQLParser. > java:108) > ... 9 more > > Please help to solve this. > > It would be great help if I get some solution ASAP for this. > > > Thanks > Suprita Bothra > > > --001a11417468efe5a7055cd56404--