homanz
Advocate I
3 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
Accessibility issue in the Share dialog of embedded Power BI reports
Accessibility issue in the Share dialog of embedded Power BI reports I would like to share an accessibility finding identified while testing an embedded Power BI report published as part of the cont...ugartema3 hours agoNew MemberNew9Views1like0CommentsAbility to Isolate Fabric Workspaces Across Browser Tabs and Windows - Power Bi Service
When opening a Fabric workspace in a new browser tab, I cant keep different workspaces open across multiple tabs. The workspace context appears to be shared between tabs. For example: Tab 1 = Dev...aashraysood4 hours agoMicrosoft EmployeeNew109Views9likes2CommentsEventhouse Event Hub Ingestion: Respect retrieval start date during preview sampling
In the Eventhouse / KQL Database "Get Data" (One-Click) ingestion wizard for Azure Event Hubs, the preview/inspection engine samples messages starting from the oldest retained events in the partition...dskiftesvik4 hours agoNew MemberNew4Views0likes0CommentsSupport VNet data gateway connections in Power BI Report Builder (Get data / Power Query)
Power BI Report Builder can't use a VNet data gateway connection. In Get data (Power Query), the Data gateway field shows "none" and can't be changed, so the query goes straight to the source over th...ilia_ryzhkov11 hours agoNew MemberNew23Views2likes0CommentsOption to set custom width for gridlines OR fixed outer padding
When designing reports, using the align and distribute evenly options in the format pane are useful, however when designing report pages with fixed bleeds between visuals I have to follow these steps...IolaWhiteley19 hours agoAdvocate IINew11Views0likes0Comments