Details
Description
For an INSERT INTO/OVERWRITE statement, we should add necessary Cast and Alias to the output of the query.
CREATE TEMPORARY TABLE jsonTable (a int, b string) USING org.apache.spark.sql.json.DefaultSource OPTIONS ( path '...' ) INSERT OVERWRITE TABLE jsonTable SELECT a * 2, a * 4 FROM table
For a*2, we should create an Alias, so the InsertableRelation can know it is the column a. For a*4, it is actually the column b in jsonTable. We should first cast it to StringType and add an Alias b to it.
Attachments
Issue Links
- links to