SparkSQL - support writing DecimalTypes and BigInts

Open
#9,556 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
scala, sql

Research direction

Start in GeoMesaSparkSQL.scala at structType2SFT, especially the handling reported around lines 115-117, and trace how createRelation converts the Spark SQL schema for writes. Add support for DecimalType and BigInt values, then verify that the SparkSQL GeoMesa write shown in the issue completes successfully.

Written by the indexing model from the issue text.

Description

SparkSQL - support writing DecimalTypes and BigInts

geodf.write.format("geomesa").option("fs.path", "myGeomesaFSDS").option("geomesa.feature", "featureName").save cala.MatchError: DecimalType(38,0) (of class org.apache.spark.sql.types.DecimalType) at org.locationtech.geomesa.spark.GeoMesaDataSource$$anonfun$structType2SFT$2.apply(GeoMesaSparkSQL.scala:117) at org.locationtech.geomesa.spark.GeoMesaDataSource$$anonfun$structType2SFT$2.apply(GeoMesaSparkSQL.scala:116) at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33) at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186) at org.locationtech.geomesa.spark.GeoMesaDataSource.structType2SFT(GeoMesaSparkSQL.scala:115) at org.locationtech.geomesa.spark.GeoMesaDataSource.createRelation(GeoMesaSparkSQL.scala:166) at org.apache.spark.sql.execution.datasources.DataSource.write(DataSource.scala:471)


Original JIRA Issue: https://geomesa.atlassian.net/browse/GEOMESA-2285

Key: GEOMESA-2285
Type: Story
Priority: Major
Status: To Do
Resolution: Unresolved
Reporter: Emilio Lahr-Vivaz
Created: Fri, 25 May 2018 11:05:18 -0400
Updated: Fri, 1 Jun 2018 08:37:09 -0400

Dominant language
Scala
Stars
1.5k
Forks
446
Avg merge
1d 8h
Merged PRs (30d)
31

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from locationtech/geomesa

All issues in locationtech/geomesa

Similar issues

More Scala issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.