NullPointerException when asking for batched TableEnvironment

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

NullPointerException when asking for batched TableEnvironment

André Schütz
Hi,

within the Flink Interpreter context, we try to get a Batch
TableEnvironment with the following code. The code was executed within
a Apache Zeppelin paragraph.

[code]
import org.apache.flink.table.api._
import org.apache.flink.table.api.scala._
import org.apache.flink.table.sources._

val batchEnvironment      = benv
val batchTableEnvironment = TableEnvironment.getTableEnvironment
(batchEnvironment) [/code]

When executing the paragraph, we get the following error.

[error]
Caused by: java.lang.ExceptionInInitializerError:
java.lang.NullPointerException
Caused by: java.lang.NullPointerException
  at org.apache.flink.table.api.scala.BatchTableEnvironment.<init>
(BatchTableEnvironment.scala:47) at
org.apache.flink.table.api.TableEnvironment$.getTableEnvironment
(TableEnvironment.scala:1049)
[/error]

Any ideas why there is the NullPointerException?

I am grateful for any ideas.

Kind regards,
Andre

--
Andre Schütz
COO / Founder - Wegtam GmbH
[hidden email] | P: +49 (0) 381-80 699 041 | M: +49 (0) 176-218 02 604
www.wegtam.com | www.tensei-data.com | www.wegtam.net
Reply | Threaded
Open this post in threaded view
|

Re: NullPointerException when asking for batched TableEnvironment

Timo Walther
Hi,

by looking at the source code it seems that your "batchEnvironment" is
null. Did you verify this?

Regards,
Timo


Am 2/14/18 um 1:01 PM schrieb André Schütz:

> Hi,
>
> within the Flink Interpreter context, we try to get a Batch
> TableEnvironment with the following code. The code was executed within
> a Apache Zeppelin paragraph.
>
> [code]
> import org.apache.flink.table.api._
> import org.apache.flink.table.api.scala._
> import org.apache.flink.table.sources._
>
> val batchEnvironment      = benv
> val batchTableEnvironment = TableEnvironment.getTableEnvironment
> (batchEnvironment) [/code]
>
> When executing the paragraph, we get the following error.
>
> [error]
> Caused by: java.lang.ExceptionInInitializerError:
> java.lang.NullPointerException
> Caused by: java.lang.NullPointerException
>    at org.apache.flink.table.api.scala.BatchTableEnvironment.<init>
> (BatchTableEnvironment.scala:47) at
> org.apache.flink.table.api.TableEnvironment$.getTableEnvironment
> (TableEnvironment.scala:1049)
> [/error]
>
> Any ideas why there is the NullPointerException?
>
> I am grateful for any ideas.
>
> Kind regards,
> Andre
>

Reply | Threaded
Open this post in threaded view
|

Re: NullPointerException when asking for batched TableEnvironment

André Schütz
Hi,

to concretizise the example. We get the batch table environment.
Process some data and get results. After that we receive a stream table
environment and after executing the stream, the system throws the batch
null pointer exception. Means, the batch table environment already
processed some data and delivered results.

[code]
val batchEnvironment      = benv
val batchTableEnvironment = TableEnvironment.getTableEnvironment
(batchEnvironment)

// Do some stuff

val res = A collection of data

val streamEnvironment = senv
streamEnvironment.setStreamTimeCharacteristic(TimeCharacteristic.EventTime)
streamEnvironment.setParallelism(1)
val streamTableEnvironment = TableEnvironment.getTableEnvironment(streamEnvironment)

val sink = // Some stream stuff

streamEnvironment.execute()
[/code]

At the end, we get the NullPointerException.

Kind regards,
Andre

On Wed, 14 Feb 2018 13:55:40 +0100
Timo Walther <[hidden email]> wrote:

> Hi,
>
> by looking at the source code it seems that your "batchEnvironment" is
> null. Did you verify this?
>
> Regards,
> Timo
>
>
> Am 2/14/18 um 1:01 PM schrieb André Schütz:
> > Hi,
> >
> > within the Flink Interpreter context, we try to get a Batch
> > TableEnvironment with the following code. The code was executed within
> > a Apache Zeppelin paragraph.
> >
> > [code]
> > import org.apache.flink.table.api._
> > import org.apache.flink.table.api.scala._
> > import org.apache.flink.table.sources._
> >
> > val batchEnvironment      = benv
> > val batchTableEnvironment = TableEnvironment.getTableEnvironment
> > (batchEnvironment) [/code]
> >
> > When executing the paragraph, we get the following error.
> >
> > [error]
> > Caused by: java.lang.ExceptionInInitializerError:
> > java.lang.NullPointerException
> > Caused by: java.lang.NullPointerException
> >    at org.apache.flink.table.api.scala.BatchTableEnvironment.<init>
> > (BatchTableEnvironment.scala:47) at
> > org.apache.flink.table.api.TableEnvironment$.getTableEnvironment
> > (TableEnvironment.scala:1049)
> > [/error]
> >
> > Any ideas why there is the NullPointerException?
> >
> > I am grateful for any ideas.
> >
> > Kind regards,
> > Andre
> >
>


--
Andre Schütz
COO / Founder - Wegtam GmbH
[hidden email] | P: +49 (0) 381-80 699 041 | M: +49 (0) 176-218 02 604
www.wegtam.com | www.tensei-data.com | www.wegtam.net