hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arvind Prabhakar (JIRA)" <>
Subject [jira] Commented: (HIVE-1176) 'create if not exists' fails for a table name with 'select' in it
Date Wed, 16 Jun 2010 18:36:24 GMT


Arvind Prabhakar commented on HIVE-1176:

bq. Can you elaborate on what you mean by 'some collections were being fetched as semi-populated
proxies with missing session context leading to NPEs'? Is there something I can do to reproduce

@Paul: Here are the steps to reproduce this problem:

# Startout with a clean workspace checkout and apply the updated patch HIVE-1176-2.patch.

# Manually revert the file {{metastore/src/java/org/apache/hadoop/hive/metastore/}}
to its previous state
# run {{ant package}} from the root of the workspace
# run {{ant test}} from within metastore

You should see failures like the following:
    [junit] testPartition() failed.
    [junit] java.lang.NullPointerException
    [junit] 	at
    [junit] 	at
    [junit] 	at org.datanucleus.sco.backed.Map.put(
    [junit] 	at org.apache.hadoop.hive.metastore.api.Table.putToParameters(
    [junit] 	at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.alter_table(
    [junit] 	at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.alter_table(
    [junit] 	at org.apache.hadoop.hive.metastore.TestHiveMetaStore.testAlterTable(
    [junit] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

If you look at {{src/gen-javabean/org/apache/hadoop/hive/metastore/api/}} you would
notice that the line causing this exception should ideally be a {{HashMap}} and not an {{}}
as indicated by the stack trace. This happens because the datanucleus JDO framework replaces
collections with its own implementation in order to allow lazy-dereferencing and optimize
for database connections/queries/memory consumption etc.

Lazy loading of collections (and second class objects in general) can be disabled at a global
level or at entity level. Disabling this globally is generally not recommended unless there
is evidence backed by extensive testing that supports that change. Disabling at an entity
level is still OK provided the entity object graph is fully dereferenced at all times. This
could lead to extensive memory consumption in the system in case the entity graph is huge.

My approach towards fixing the problem was to *not* change the default behavior in the general
case. Instead I felt that it was better to circumvent this problem in the case of a remote
metastore by creating a copy explicitly. If you have other suggestions on how to address this,
please let me know.

Also - more information on the lazy dereferencing mechanism used by datanucleus framework
can be found [here|].

> 'create if not exists' fails for a table name with 'select' in it
> -----------------------------------------------------------------
>                 Key: HIVE-1176
>                 URL:
>             Project: Hadoop Hive
>          Issue Type: Bug
>          Components: Metastore, Query Processor
>            Reporter: Prasad Chakka
>            Assignee: Arvind Prabhakar
>             Fix For: 0.6.0
>         Attachments: HIVE-1176-1.patch, HIVE-1176-2.patch, HIVE-1176.lib-files.tar.gz,
> hive> create table if not exists tmp_select(s string, c string, n int);
> org.apache.hadoop.hive.ql.metadata.HiveException: MetaException(message:Got exception:
javax.jdo.JDOUserException JDOQL Single-String query should always start with SELECT)
>         at org.apache.hadoop.hive.ql.metadata.Hive.getTablesForDb(
>         at org.apache.hadoop.hive.ql.metadata.Hive.getTablesByPattern(
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeCreateTable(
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(
>         at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(
>         at org.apache.hadoop.hive.ql.Driver.compile(
>         at org.apache.hadoop.hive.ql.Driver.runCommand(
>         at
>         at org.apache.hadoop.hive.cli.CliDriver.processCmd(
>         at org.apache.hadoop.hive.cli.CliDriver.processLine(
>         at org.apache.hadoop.hive.cli.CliDriver.main(
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>         at java.lang.reflect.Method.invoke(
>         at org.apache.hadoop.util.RunJar.main(
> Caused by: MetaException(message:Got exception: javax.jdo.JDOUserException JDOQL Single-String
query should always start with SELECT)
>         at org.apache.hadoop.hive.metastore.MetaStoreUtils.logAndThrowMetaException(
>         at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.getTables(
>         at org.apache.hadoop.hive.ql.metadata.Hive.getTablesForDb(
>         ... 15 more

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message