You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@zeppelin.apache.org by Metin OSMAN <mo...@mixdata.com> on 2018/09/19 16:42:57 UTC
Leading Zeros with spark.sql interpreter
Hi,
I have a DataFrame with String colums containing only numbers like values, but with leading zeros.
when I query the DF through a temptable in a spark.sql interpreter, the table shows the values without the leading zeros.
If I export the data to a csv file, the zeros are also removed.
I don't know if this is an issue with the table viewer, or is it in the way that I construct the query ?
Here is a sample :
----
%spark
val values = List("001", "01", "1234")
import spark.implicits._
val df = values.toDF
df.registerTempTable("temp")
%sql
select value from temp
----
The resulting table shows :
1
1
1234
Thanks for your help,
Metin
Re: Leading Zeros with spark.sql interpreter
Posted by Metin OSMAN <mo...@mixdata.com>.
Good news, thank you !
On sept. 20 2018, at 2:36 am, Jeff Zhang <zj...@gmail.com> wrote:
>
>
> It is fixed in ZEPPELIN-3701, I will backport it to branch-0.8.
>
>
>
> Metin OSMAN <mosman@mixdata.com (mailto:mosman@mixdata.com)>于2018年9月20日周四 上午12:43写道:
> > Hi,
> >
> > I have a DataFrame with String colums containing only numbers like values, but with leading zeros.
> > when I query the DF through a temptable in a spark.sql interpreter, the table shows the values without the leading zeros.
> > If I export the data to a csv file, the zeros are also removed.
> >
> > I don't know if this is an issue with the table viewer, or is it in the way that I construct the query ?
> > Here is a sample :
> > ----
> > %spark
> >
> > val values = List("001", "01", "1234")
> > import spark.implicits._
> > val df = values.toDF
> > df.registerTempTable("temp")
> >
> > %sql
> > select value from temp
> > ----
> >
> > The resulting table shows :
> > 1
> > 1
> > 1234
> >
> > Thanks for your help,
> > Metin
Re: Leading Zeros with spark.sql interpreter
Posted by Jeff Zhang <zj...@gmail.com>.
It is fixed in ZEPPELIN-3701, I will backport it to branch-0.8.
Metin OSMAN <mo...@mixdata.com>于2018年9月20日周四 上午12:43写道:
> Hi,
>
> I have a DataFrame with String colums containing only numbers like values,
> but with leading zeros.
>
> when I query the DF through a temptable in a spark.sql interpreter, the
> table shows the values without the leading zeros.
> If I export the data to a csv file, the zeros are also removed.
>
> I don't know if this is an issue with the table viewer, or is it in the
> way that I construct the query ?
>
> Here is a sample :
>
> ----
> %spark
>
> val values = List("001", "01", "1234")
> import spark.implicits._
> val df = values.toDF
> df.registerTempTable("temp")
>
> %sql
> select value from temp
> ----
>
> The resulting table shows :
> 1
> 1
> 1234
>
> Thanks for your help,
>
> Metin
>
>
>
>