2016-01-20 40 views
2

我嘗試連接查詢遠程Postgres數據庫 -阿帕奇齊柏林Postgres的空指針異常

%psql.sql 

select * from my_schema.my_table limit 5 

我已經更新瞭解釋值,但我仍然得到下面的錯誤 -

java.lang.NullPointerException at org.apache.zeppelin.postgresql.PostgreSqlInterpreter.executeSql(PostgreSqlInterpreter.java:201) at org.apache.zeppelin.postgresql.PostgreSqlInterpreter.interpret(PostgreSqlInterpreter.java:288) at org.apache.zeppelin.interpreter.ClassloaderInterpreter.interpret(ClassloaderInterpreter.java:57) at org.apache.zeppelin.interpreter.LazyOpenInterpreter.interpret(LazyOpenInterpreter.java:93) at org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:302) at org.apache.zeppelin.scheduler.Job.run(Job.java:171) at org.apache.zeppelin.scheduler.FIFOScheduler$1.run(FIFOScheduler.java:139) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

我試着從外殼訪問,但得到了一個錯誤 -

Process exited with an error: 2 (Exit value: 2)

我懷疑它涉及到它的事實, s來獲得密碼。然而,相同的命令+密碼在我的終端上工作。

其他相關問題是解釋器中的屬性不包含數據庫名稱。我將它添加爲postgresql.database,但我不確定是否使用此屬性。

請讓我知道如果你有任何想法如何解決它,謝謝!

+0

請問下面的答案可以幫助?如果不善意添加細節作爲意見 – sag

+0

這是有益的,因此我upvoted它 –

+0

你找到一種方法來解決這個問題OP? –

回答

4

您的財產postgresql.database不會被zeppelin挑選。

在postgres jdbc URL屬性中指定數據庫名稱。像JDBC:在PostgreSQL://主機:端口/數據庫

參考,https://jdbc.postgresql.org/documentation/80/connect.html更多細節上的Postgres JDBC URL

+0

謝謝,這也解決了Flyway 4.2.0 clean和遷移java.lang.NullPointerException – danialk

0

有些憑據的過程可能是錯的。我的用戶名輸入錯誤,並得到了類似的東西:

java.lang.NullPointerException at org.apache.zeppelin.postgresql.PostgreSqlInterpreter.executeSql(PostgreSqlInterpreter.java:202)