You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@zeppelin.apache.org by "Xu (Simon) Chen" <xc...@gmail.com> on 2015/04/17 21:30:39 UTC

registerTempTable doesn't do anything

Hey folks,

I am running the latest zeppelin with spark 1.3 on yarn.

I using sqlContext.avroFile() to load avro files from HDFS, like the
following:
val data = sqlContext.avroFile("hdfs://xxx")
data.count
data.registerTempTable("table")

Strangely, if I do "%sql select * from table", it shows "no such table
List(table); line 0 pos 0", as if the registerTempTable command never
happened. I don't see anything in the log it seems.

Any ideas?

Thanks.
-Simon

Re: registerTempTable doesn't do anything

Posted by "Kevin Kim (Sangwoo)" <ke...@between.us>.
Yes that has always been a trap..
Cheers!

On 2015년 4월 18일 (토) 오전 11:37 Xu (Simon) Chen <xc...@gmail.com> wrote:

> Ah, mystery solved... I was creating my own sqlContext, while zeppelin
> already created one available as "sqlc", which the "%sql xx" queries use.
> Everything works now ;-)
>

Re: registerTempTable doesn't do anything

Posted by "Xu (Simon) Chen" <xc...@gmail.com>.
Ah, mystery solved... I was creating my own sqlContext, while zeppelin
already created one available as "sqlc", which the "%sql xx" queries use.
Everything works now ;-)

Re: registerTempTable doesn't do anything

Posted by "Xu (Simon) Chen" <xc...@gmail.com>.
BTW, if I do sqlContext.sql("select * from table") in zeppelin, it will
show "org.apache.spark.sql.DataFrame = [... (schema) ...]", but no entries.

On the other hand, the example online (creating a DF using case classes)
works for me...

On Fri, Apr 17, 2015 at 3:30 PM, Xu (Simon) Chen <xc...@gmail.com> wrote:

> Hey folks,
>
> I am running the latest zeppelin with spark 1.3 on yarn.
>
> I using sqlContext.avroFile() to load avro files from HDFS, like the
> following:
> val data = sqlContext.avroFile("hdfs://xxx")
> data.count
> data.registerTempTable("table")
>
> Strangely, if I do "%sql select * from table", it shows "no such table
> List(table); line 0 pos 0", as if the registerTempTable command never
> happened. I don't see anything in the log it seems.
>
> Any ideas?
>
> Thanks.
> -Simon
>
>