[ https://issues.apache.org/jira/browse/SPARK-25936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16674378#comment-16674378 ]
Apache Spark commented on SPARK-25936: -------------------------------------- User 'wangyum' has created a pull request for this issue: https://github.com/apache/spark/pull/22941 > InsertIntoDataSourceCommand does not use Cached Data > ---------------------------------------------------- > > Key: SPARK-25936 > URL: https://issues.apache.org/jira/browse/SPARK-25936 > Project: Spark > Issue Type: Bug > Components: SQL > Affects Versions: 3.0.0 > Reporter: Yuming Wang > Priority: Major > > How to reproduce this issue: > {code:scala} > spark.sql(""" > CREATE TABLE jdbcTable > USING org.apache.spark.sql.jdbc > OPTIONS ( > url "jdbc:mysql://localhost:3306/test", > dbtable "test.InsertIntoDataSourceCommand", > user "hive", > password "hive" > )""") > spark.range(2).createTempView("test_view") > spark.catalog.cacheTable("test_view") > spark.sql("INSERT INTO TABLE jdbcTable SELECT * FROM test_view").explain > {code} > {noformat} > == Physical Plan == > > Execute InsertIntoDataSourceCommand > +- InsertIntoDataSourceCommand > +- Project > +- SubqueryAlias > +- Range (0, 2, step=1, splits=Some(8)) > {noformat} > It should be: > {noformat} > == Physical Plan == > > Execute InsertIntoDataSourceCommand InsertIntoDataSourceCommand > Relation[id#8L] JDBCRelation(test.InsertIntoDataSourceCommand) > [numPartitions=1], false, [id] > +- *(1) InMemoryTableScan [id#0L] > +- InMemoryRelation [id#0L], StorageLevel(disk, memory, deserialized, 1 > replicas) > +- *(1) Range (0, 2, step=1, splits=8) > {noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org