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 73BDF200CC5 for ; Mon, 26 Jun 2017 10:53:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 72499160BF5; Mon, 26 Jun 2017 08:53:05 +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 B733F160BDE for ; Mon, 26 Jun 2017 10:53:04 +0200 (CEST) Received: (qmail 32688 invoked by uid 500); 26 Jun 2017 08:53:03 -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 32666 invoked by uid 99); 26 Jun 2017 08:53:03 -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; Mon, 26 Jun 2017 08:53:03 +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 110101A052B for ; Mon, 26 Jun 2017 08:53:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, 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 zg2FZ5bXc6Ly for ; Mon, 26 Jun 2017 08:53: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 2FF285F659 for ; Mon, 26 Jun 2017 08:53: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 621BEE0363 for ; Mon, 26 Jun 2017 08:53: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 14E9F21940 for ; Mon, 26 Jun 2017 08:53:00 +0000 (UTC) Date: Mon, 26 Jun 2017 08:53:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (PHOENIX-3944) ReadOnlyTableException occurs when we map Phoenix view to an existing HBase table with Namespace Mapping enabled MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 26 Jun 2017 08:53:05 -0000 [ https://issues.apache.org/jira/browse/PHOENIX-3944?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16062800#comment-16062800 ] ASF GitHub Bot commented on PHOENIX-3944: ----------------------------------------- Github user brfrn169 commented on a diff in the pull request: https://github.com/apache/phoenix/pull/261#discussion_r123958036 --- Diff: phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java --- @@ -1184,8 +1184,11 @@ public synchronized boolean getIndexMaintainers(ImmutableBytesWritable ptr, Phoe @Override public PName getPhysicalName() { - return SchemaUtil.getPhysicalHBaseTableName(physicalNames.isEmpty() ? getName() : physicalNames.get(0), - isNamespaceMapped, type); + if (physicalNames.isEmpty()) { --- End diff -- I changed this logic to handle "AAA.BBB"(without schema) correctly. > ReadOnlyTableException occurs when we map Phoenix view to an existing HBase table with Namespace Mapping enabled > ---------------------------------------------------------------------------------------------------------------- > > Key: PHOENIX-3944 > URL: https://issues.apache.org/jira/browse/PHOENIX-3944 > Project: Phoenix > Issue Type: Bug > Reporter: Toshihiro Suzuki > > Firstly, I created a namespace and a table in hbase shell: > {code} > hbase> create_namespace "NS" > hbase> create "NS:TBL", "CF" > {code} > After that, I tried to create a phoenix view for this existing hbase table in phoenix-sqlline: > {code} > phoenix> CREATE VIEW ns.tbl (pk VARCHAR PRIMARY KEY, cf.col VARCHAR); > {code} > However, I encountered the following error and I was not able to create the view: > {code} > org.apache.phoenix.schema.ReadOnlyTableException: ERROR 505 (42000): Table is read only. > at org.apache.phoenix.query.ConnectionQueryServicesImpl.ensureTableCreated(ConnectionQueryServicesImpl.java:1072) > at org.apache.phoenix.query.ConnectionQueryServicesImpl.createTable(ConnectionQueryServicesImpl.java:1434) > at org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:2624) > at org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:1040) > at org.apache.phoenix.compile.CreateTableCompiler$2.execute(CreateTableCompiler.java:212) > at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:393) > at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:376) > at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53) > at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:375) > at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:363) > at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1707) > at org.apache.PhoenixTest.main(PhoenixTest.java:55) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)