I tested below queries using Databricks with Apache Spark 2.4:
%sql
<step1>
create temporary view temp_view_t
as select 1 as no, 'aaa' as str;
<step2>
insert into temp_view_t values (2,'bbb');
And then I got this error message.
Error in SQL statement: AnalysisException: Inserting into an RDD-based table is not allowed.;; 'InsertIntoTable Project [1 AS no#824, aaa AS str#825], false, false +- LocalRelation [col1#831, col2#832]
My questions are
- Is it impossible to insert into temporary table in spark?
- How can I work for creating temporary data in spark sql?
Thank you.