homanz
Advocate I
5 months agoStatus:
New
Enable Spark SQL to create temporary views using tables with schema
Hi MS Support team,
Currently, when you use Spark SQL to create a temp view with tables that have schema name, the temp view can't be used in later steps.
For example,
Firstly, create a temp view using below code
CREATE OR REPLACE TEMPORARY VIEW tmpvw1 AS
SELECT
*
FROM
IM.test t1
LEFT JOIN ref.testref t2
ON t1.key= t2.key
In next step, select the temp view tmpvw1 using the following code:
SELECT * FROM tmpvw1
You will see a error message similar to below
"Error
[TABLE_OR_VIEW_NOT_FOUND] The table or view `IM`.`test` cannot be found. Verify the spelling and correctness of the schema and catalog. If you did not qualify the name with a schema, verify the current_schema() output, or qualify the name with the correct schema and catalog. To tolerate the error on drop use DROP VIEW IF EXISTS or DROP TABLE IF EXISTS. SQLSTATE: 42P01; line 1 pos 14; 'Project [upcast(getviewcolumnbynameandordinal(`tmpvw1`, new_column, 0, 1), StringType) AS new_column#690, upcast(getviewcolumnbynameandordinal(`tmpvw1`, TestCol, 0, 1), StringType) AS TestCol#691] +- 'Project [*] +- 'UnresolvedRelation [IM, test], [], false"
In PySpark, it works fine. The current workaround is to encapsulate the SQL code inside a PySpark code.
%%pyspark
spark.sql("""
--insert SQL code belowSELECT
*
from
IM.test t1
left join
ref.testref t2
on t1.key= t2.key
""").createOrReplaceTempView("tmp_python_view")
Could you please enable Spark SQL to create temporary views using tables with schema, just as PySpark does?
Thanks,
Homan
No CommentsBe the first to comment
Recent ideas
Convert Standard Lakehouse to Schema Based Lakehouse
When Schema based Fabric Lakehouse's come out of Public Preview, it would be AMAZING and gamechanging to be able to convert a standard lakehouse into a Schema based lakehouse. Right now we organ...dbrugger53 minutes agoRegular VisitorNew380Views2likes2CommentsDeployment rules can be used on Dataflows Gen2 (CI/CD)
Hi, We currently have a lot of dataflows gen1. We use 3 environments in our deployment pipelines (DEV - TST - PRD). Our company is investigating to upgrade our dataflows from gen1 to gen2. ...DonHoog54 minutes agoAdvocate INeed Clarification490Views7likes2CommentsEnable Managed Identity Authentication for Event Hubs in Event Stream Inputs
Currently, EventStream supports adding Event Hub as an input source using the SAS Key authentication method. Please add support for Managed Identity–based authentication so that EventStream can align...VChimbili1 hour agoMicrosoft EmployeePlanned1.3KViews12likes9Commentsnotebookutils.credentials.getToken: Add more audience keys
Currently, only 4 audiences are listed in the docs: Audience key Resource Use case storage Azure Storage Access ADLS Gen2 and Blob Storage pbi Power BI Call Power BI and Fabric RES...frithjof_v4 hours agoCommunity ChampionNew14Views0likes0Comments