You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by VISHNU SUBRAMANIAN <jo...@gmail.com> on 2015/03/05 18:52:56 UTC

problems facing with SchemaRDD

Hi,

I am trying to use zeppelin. I executed the below commands.

*import org.apache.spark.sql.SQLContext*
*val rawData = sc.textFile("12345.txt")*
*    val sqlContext = new SQLContext(sc)*
*    val recordsJson = sqlContext.jsonRDD(rawData)*
*    recordsJson.registerTempTable("records")*
*%sql select tz from records*

I get the below error when i put the above code in one paragraph.

*<console>:36: error: not found: value % %sql select tz from records*

I get the below error when I have the last line in a different paragraph.

*%sql select tz from records*
*Table Not Found: records*

I am using the latest version built against spark-1.2

Can some one help me to find what I am missing?

Thanks,
Vishnu

Re: problems facing with SchemaRDD

Posted by "Kevin Kim (Sangwoo)" <ke...@between.us>.
Sql context is pre-defimed as sqlc, you may use that.
Cheers!

On 2015년 3월 6일 (금) 02:54 VISHNU SUBRAMANIAN <jo...@gmail.com>
wrote:

> Hi,
>
> I am trying to use zeppelin. I executed the below commands.
>
> *import org.apache.spark.sql.SQLContext*
> *val rawData = sc.textFile("12345.txt")*
> *    val sqlContext = new SQLContext(sc)*
> *    val recordsJson = sqlContext.jsonRDD(rawData)*
> *    recordsJson.registerTempTable("records")*
> *%sql select tz from records*
>
> I get the below error when i put the above code in one paragraph.
>
> *<console>:36: error: not found: value % %sql select tz from records*
>
> I get the below error when I have the last line in a different paragraph.
>
> *%sql select tz from records*
> *Table Not Found: records*
>
> I am using the latest version built against spark-1.2
>
> Can some one help me to find what I am missing?
>
> Thanks,
> Vishnu
>