Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 43B5C911F for ; Wed, 25 Jan 2012 00:31:08 +0000 (UTC) Received: (qmail 28698 invoked by uid 500); 25 Jan 2012 00:31:07 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 28341 invoked by uid 500); 25 Jan 2012 00:31:07 -0000 Mailing-List: contact dev-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 dev@hive.apache.org Received: (qmail 27977 invoked by uid 500); 25 Jan 2012 00:31:06 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 27971 invoked by uid 99); 25 Jan 2012 00:31:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jan 2012 00:31:06 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jan 2012 00:31:05 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 70BBA15F9FF for ; Wed, 25 Jan 2012 00:30:45 +0000 (UTC) Date: Wed, 25 Jan 2012 00:30:45 +0000 (UTC) From: "Thomas Weise (Commented) (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: <1369442676.74819.1327451445469.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1356385802.11194.1322209599931.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HIVE-2609) NPE when pruning partitions by thrift method get_partitions_by_filter MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-2609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13192699#comment-13192699 ] Thomas Weise commented on HIVE-2609: ------------------------------------ We replace them after the build. > NPE when pruning partitions by thrift method get_partitions_by_filter > --------------------------------------------------------------------- > > Key: HIVE-2609 > URL: https://issues.apache.org/jira/browse/HIVE-2609 > Project: Hive > Issue Type: Bug > Components: Metastore > Affects Versions: 0.7.1 > Reporter: Min Zhou > > It's a datanucleus bug indeed. > try this code: > {code} > boolean open = false; > for (int i = 0; i < 5 && !open; ++i) { > try { > transport.open(); > open = true; > } catch (TTransportException e) { > System.out.println("failed to connect to MetaStore, re-trying..."); > try { > Thread.sleep(1000); > } catch (InterruptedException ignore) {} > } > } > try { > List parts = > client.get_partitions_by_filter("default", "partitioned_nation", > "pt < '2'", (short) -1); > for (Partition part : parts) { > System.out.println(part.getSd().getLocation()); > } > } catch (Exception te) { > te.printStackTrace(); > } > {code} > A NPEexception would be thrown on the thrift server side > {noformat} > 11/11/25 13:11:55 ERROR api.ThriftHiveMetastore$Processor: Internal error processing get_partitions_by_filter > java.lang.NullPointerException > at org.datanucleus.store.mapped.mapping.MappingHelper.getMappingIndices(MappingHelper.java:35) > at org.datanucleus.store.mapped.expression.StatementText.applyParametersToStatement(StatementText.java:194) > at org.datanucleus.store.rdbms.query.RDBMSQueryUtils.getPreparedStatementForQuery(RDBMSQueryUtils.java:233) > at org.datanucleus.store.rdbms.query.legacy.SQLEvaluator.evaluate(SQLEvaluator.java:115) > at org.datanucleus.store.rdbms.query.legacy.JDOQLQuery.performExecute(JDOQLQuery.java:288) > at org.datanucleus.store.query.Query.executeQuery(Query.java:1657) > at org.datanucleus.store.rdbms.query.legacy.JDOQLQuery.executeQuery(JDOQLQuery.java:245) > at org.datanucleus.store.query.Query.executeWithMap(Query.java:1526) > at org.datanucleus.jdo.JDOQuery.executeWithMap(JDOQuery.java:334) > at org.apache.hadoop.hive.metastore.ObjectStore.listMPartitionsByFilter(ObjectStore.java:1329) > at org.apache.hadoop.hive.metastore.ObjectStore.getPartitionsByFilter(ObjectStore.java:1241) > at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler$40.run(HiveMetaStore.java:2369) > at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler$40.run(HiveMetaStore.java:2366) > at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.executeWithRetry(HiveMetaStore.java:307) > at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.get_partitions_by_filter(HiveMetaStore.java:2366) > at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Processor$get_partitions_by_filter.process(ThriftHiveMetastore.j > ava:6099) > at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Processor.process(ThriftHiveMetastore.java:4789) > at org.apache.hadoop.hive.metastore.HiveMetaStore$TLoggingProcessor.process(HiveMetaStore.java:3167) > at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:253) > at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:662) > {noformat} > A null JavaTypeMapping was passed into org.datanucleus.store.mapped.mapping.MappingHelper.(int initialPosition, JavaTypeMapping mapping), that caused NPE. > After digged into the datanucleus source, I found that the null value was born in the constructor of org.datanucleus.store.mapped.expression.SubstringExpression. see > {code} > /** > * Constructs the substring > * @param str the String Expression > * @param begin The start position > * @param end The end position expression > **/ > public SubstringExpression(StringExpression str, NumericExpression begin, NumericExpression end) > { > super(str.getQueryExpression()); > st.append("SUBSTRING(").append(str).append(" FROM ") > .append(begin.add(new IntegerLiteral(qs, mapping, BigInteger.ONE))) > .append(" FOR ").append(end.sub(begin)).append(')'); > } > {code} > The field mapping hasn't been instanced at that moment. > How do you deal with such a external bug? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira