LoginSignup
1
1

More than 5 years have passed since last update.

sparkで集計する際に、pathのparamをStringで扱う方法

Posted at

下記を付ければOK

.set("spark.sql.sources.partitionColumnTypeInference.enabled", "false")

付けないと、型推測されて、String以外の形式になることがある。

実際あったのが、

s3://hogehoge/hoge1=1234-12-32_XXX/…

のようなpathをsparkで取り込んだ際に、hoge1の型がdate型になり、中身の値がnullになってしまった。つらい

特にエラーも吐かないので大変でした。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1