Last active
August 29, 2015 14:00
-
-
Save sposmen/11220613 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java 1.7.0_55 | |
hadoop 2.4.0 | |
hive 0.11 | |
postgres 9.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Add BAM JDBC storage handler for hive | |
-- ADD JAR hive-jdbc-handler-0.8.1-wso2v8.jar; | |
-- Create command | |
CREATE EXTERNAL TABLE IF NOT EXISTS files( | |
url STRING, | |
publisher_id STRING, | |
application_id STRING, | |
widget_id STRING, | |
id INT, | |
createdAt TIMESTAMP, | |
updatedAt TIMESTAMP) | |
STORED BY 'org.wso2.carbon.hadoop.hive.jdbc.storage.JDBCStorageHandler' | |
TBLPROPERTIES ( | |
'mapred.jdbc.driver.class' = 'org.postgresql.Driver', | |
'mapred.jdbc.url' ='jdbc:postgresql://127.0.0.1:5432/file_db', | |
-- 'mapred.jdbc.url' ='jdbc:postgresql://127.0.0.1:5432/file_db?searchpath=public', | |
'mapred.jdbc.username' = 'postgres', | |
'mapred.jdbc.password' = 'encrypted_password', | |
'mapred.jdbc.input.table.name' = 'files', | |
-- 'mapred.jdbc.input.table.name' = 'public.files', | |
'hive.jdbc.update.on.duplicate' = 'true', | |
'hive.jdbc.primary.key.fields' = 'id' ); | |
--Select query | |
SELECT * FROM files; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# When execute the table creation command time:2014-04-23 09:14:23,342 | |
OK | |
Time taken: 0.097 seconds | |
# When execute the select command time:2014-04-23 09:15:39,071 | |
OK | |
Failed with exception java.io.IOException:java.lang.NullPointerException | |
Time taken: 0.278 seconds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2014-04-23 09:14:23,342 ERROR metastore.RetryingHMSHandler (RetryingHMSHandler.java:invoke(134)) - NoSuchObjectException(message:default.publisherfile table not found) | |
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.get_table(HiveMetaStore.java:1369) | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) | |
at java.lang.reflect.Method.invoke(Method.java:606) | |
at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:102) | |
at com.sun.proxy.$Proxy13.get_table(Unknown Source) | |
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.getTable(HiveMetaStoreClient.java:838) | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) | |
at java.lang.reflect.Method.invoke(Method.java:606) | |
at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:74) | |
at com.sun.proxy.$Proxy14.getTable(Unknown Source) | |
at org.apache.hadoop.hive.ql.metadata.Hive.getTable(Hive.java:948) | |
at org.apache.hadoop.hive.ql.metadata.Hive.getTable(Hive.java:903) | |
at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeCreateTable(SemanticAnalyzer.java:9328) | |
at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:8647) | |
at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:278) | |
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:433) | |
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:337) | |
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:902) | |
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:259) | |
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:216) | |
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:413) | |
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:756) | |
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:614) | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) | |
at java.lang.reflect.Method.invoke(Method.java:606) | |
at org.apache.hadoop.util.RunJar.main(RunJar.java:212) | |
Position: 69 | |
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157) | |
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886) | |
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255) | |
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555) | |
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:403) | |
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:283) | |
at org.wso2.carbon.hadoop.hive.jdbc.storage.db.DBRecordReader.<init>(DBRecordReader.java:59) | |
at org.wso2.carbon.hadoop.hive.jdbc.storage.input.JDBCDataInputFormat.getRecordReader(JDBCDataInputFormat.java:35) | |
at org.apache.hadoop.hive.ql.exec.FetchOperator.getRecordReader(FetchOperator.java:432) | |
at org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow(FetchOperator.java:508) | |
at org.apache.hadoop.hive.ql.exec.FetchOperator.pushRow(FetchOperator.java:488) | |
at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:136) | |
at org.apache.hadoop.hive.ql.Driver.getResults(Driver.java:1412) | |
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:271) | |
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:216) | |
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:413) | |
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:756) | |
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:614) | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) | |
at java.lang.reflect.Method.invoke(Method.java:606) | |
at org.apache.hadoop.util.RunJar.main(RunJar.java:212) | |
2014-04-23 09:15:39,071 ERROR CliDriver (SessionState.java:printError(386)) - Failed with exception java.io.IOException:java.lang.NullPointerException | |
java.io.IOException: java.lang.NullPointerException | |
at org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow(FetchOperator.java:544) | |
at org.apache.hadoop.hive.ql.exec.FetchOperator.pushRow(FetchOperator.java:488) | |
at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:136) | |
at org.apache.hadoop.hive.ql.Driver.getResults(Driver.java:1412) | |
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:271) | |
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:216) | |
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:413) | |
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:756) | |
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:614) | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) | |
at java.lang.reflect.Method.invoke(Method.java:606) | |
at org.apache.hadoop.util.RunJar.main(RunJar.java:212) | |
Caused by: java.lang.NullPointerException | |
at org.wso2.carbon.hadoop.hive.jdbc.storage.db.DBRecordReader.next(DBRecordReader.java:72) | |
at org.wso2.carbon.hadoop.hive.jdbc.storage.db.DBRecordReader.next(DBRecordReader.java:29) | |
at org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow(FetchOperator.java:514) | |
... 13 more |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment