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 1A9EE200C41 for ; Fri, 24 Mar 2017 19:18:53 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 19429160B96; Fri, 24 Mar 2017 18:18:53 +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 5F50E160B93 for ; Fri, 24 Mar 2017 19:18:52 +0100 (CET) Received: (qmail 46415 invoked by uid 500); 24 Mar 2017 18:18:51 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 46331 invoked by uid 99); 24 Mar 2017 18:18:51 -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; Fri, 24 Mar 2017 18:18:51 +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 E5B1C1A050B for ; Fri, 24 Mar 2017 18:18:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.201 X-Spam-Level: X-Spam-Status: No, score=-99.201 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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 OjCZkd7pRu-e for ; Fri, 24 Mar 2017 18:18:48 +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 39DAA60D16 for ; Fri, 24 Mar 2017 18:18:47 +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 165F3E0D2E for ; Fri, 24 Mar 2017 18:18:45 +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 E0E6E2409C for ; Fri, 24 Mar 2017 18:18:42 +0000 (UTC) Date: Fri, 24 Mar 2017 18:18:42 +0000 (UTC) From: "Aihua Xu (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-12274) Increase width of columns used for general configuration in the metastore. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 24 Mar 2017 18:18:53 -0000 [ https://issues.apache.org/jira/browse/HIVE-12274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15940858#comment-15940858 ] Aihua Xu commented on HIVE-12274: --------------------------------- The patch looks good to me. +1. > Increase width of columns used for general configuration in the metastore. > -------------------------------------------------------------------------- > > Key: HIVE-12274 > URL: https://issues.apache.org/jira/browse/HIVE-12274 > Project: Hive > Issue Type: Improvement > Components: Metastore > Affects Versions: 2.0.0 > Reporter: Elliot West > Assignee: Naveen Gangam > Labels: metastore > Attachments: HIVE-12274.2.patch, HIVE-12274.3.patch, HIVE-12274.4.patch, HIVE-12274.5.patch, HIVE-12274.example.ddl.hql, HIVE-12274.patch > > > h2. Overview > This issue is very similar in principle to HIVE-1364. We are hitting a limit when processing JSON data that has a large nested schema. The struct definition is truncated when inserted into the metastore database column {{COLUMNS_V2.YPE_NAME}} as it is greater than 4000 characters in length. > Given that the purpose of these columns is to hold very loosely defined configuration values it seems rather limiting to impose such a relatively low length bound. One can imagine that valid use cases will arise where reasonable parameter/property values exceed the current limit. > h2. Context > These limitations were in by the [patch attributed|https://github.com/apache/hive/commit/c21a526b0a752df2a51d20a2729cc8493c228799] to HIVE-1364 which mentions the _"max length on Oracle 9i/10g/11g"_ as the reason. However, nowadays the limit can be increased because: > * Oracle DB's {{varchar2}} supports 32767 bytes now, by setting the configuration parameter {{MAX_STRING_SIZE}} to {{EXTENDED}}. ([source|http://docs.oracle.com/database/121/SQLRF/sql_elements001.htm#SQLRF55623]) > * Postgres supports a max of 1GB for {{character}} datatype. ([source|http://www.postgresql.org/docs/8.3/static/datatype-character.html]) > * MySQL can support upto 65535 bytes for the entire row. So long as the {{PARAM_KEY}} value + {{PARAM_VALUE}} is less than 65535, we should be good. ([source|http://dev.mysql.com/doc/refman/5.0/en/char.html]) > * SQL Server's {{varchar}} max length is 8000 and can go beyond using "varchar(max)" with the same limitation as MySQL being 65535 bytes for the entire row. ([source|http://dev.mysql.com/doc/refman/5.0/en/char.html]) > * Derby's {{varchar}} can be upto 32672 bytes. ([source|https://db.apache.org/derby/docs/10.7/ref/rrefsqlj41207.html]) > h2. Proposal > Can these columns not use CLOB-like types as for example as used by {{TBLS.VIEW_EXPANDED_TEXT}}? It would seem that suitable type equivalents exist for all targeted database platforms: > * MySQL: {{mediumtext}} > * Postgres: {{text}} > * Oracle: {{CLOB}} > * Derby: {{LONG VARCHAR}} > I'd suggest that the candidates for type change are: > * {{COLUMNS_V2.TYPE_NAME}} > * {{TABLE_PARAMS.PARAM_VALUE}} > * {{SERDE_PARAMS.PARAM_VALUE}} > * {{SD_PARAMS.PARAM_VALUE}} > After updating the maximum length the metastore database needs to be configured and restarted with the new settings. Altering {{MAX_STRING_SIZE}} will update database objects and possibly invalidate them, as follows: > * Tables with virtual columns will be updated with new data type metadata for virtual columns of {{VARCHAR2(4000)}}, 4000-byte {{NVARCHAR2}}, or {{RAW(2000)}} type. > * Functional indexes will become unusable if a change to their associated virtual columns causes the index key to exceed index key length limits. Attempts to rebuild such indexes will fail with {{ORA-01450: maximum key length exceeded}}. > * Views will be invalidated if they contain {{VARCHAR2(4000)}}, 4000-byte {{NVARCHAR2}}, or {{RAW(2000)}} typed expression columns. > * Materialized views will be updated with new metadata {{VARCHAR2(4000)}}, 4000-byte {{NVARCHAR2}}, and {{RAW(2000)}} typed expression columns > * So the limitation could be raised to 32672 bytes, with the caveat that MySQL and SQL Server limit the row length to 65535 bytes, so that should also be validated to provide consistency. > Finally, will this limitation persist in the work resulting from HIVE-9452? -- This message was sent by Atlassian JIRA (v6.3.15#6346)