Forum Discussion

besab's avatar
besab
Frequent Visitor
5 months ago
Solved

org.apache.hadoop.hive.ql.metadata.HiveException: MetaException(message:Unable to fetch mwc token)

I have a notebook on workspace A that queries a table on a lakehouse in workspace B. 
The lakehouse is not attached to the notebook as we attach another default lakehouse.
When I run the pipeline that includes the notebook, the Spark SQL query runs to query the table in workspace B, it fails with below error: 
AnalysisException
org.apache.hadoop.hive.ql.metadata.HiveException: MetaException(message:Unable to fetch mwc token)
 
I am using the full ABFSS path of the lakehouse (because it's not attached to the notebook), so my query looks something like:
SELECT * FROM
delta.`abfss://[email protected]/my_lakehouse.lakehouse/my_table`
 
And it seems to be intermittent error, sometimes it works, othertimes it throws the error.
 
Any suggestions on cross-workspace lakehouse SQL queries?
  • Hello besab 

     

    To stabilise cross‑workspace access, it is recommended to avoid name‑based ABFSS paths and instead use GUID‑based OneLake paths, which are more reliable and immune to workspace renames or spaces. 
     
    delta.`abfss://<workspaceGUID>@onelake.dfs.fabric.microsoft.com/<lakehouseGUID>/Tables/<tableOrSchemaPath>`
     
    Inside the Workspace B Lakehouse UI, right click on the Table and select Properties. Copy the ABFS path value - this should give you the GUID based absolute path. 
     
    Additionally, ensure the notebook always has a Lakehouse attached (even if it is not the source Lakehouse) and that the pipeline identity is granted at least Member/Contributor access to Workspace B and its Lakehouse.
     
    If you can, add a Shortcut in A pointing to B’s table, and then query it with a simple SELECT * FROM schema.table (or the delta path under the shortcut).
     

5 Replies

  • Hello besab 

     

    To stabilise cross‑workspace access, it is recommended to avoid name‑based ABFSS paths and instead use GUID‑based OneLake paths, which are more reliable and immune to workspace renames or spaces. 
     
    delta.`abfss://<workspaceGUID>@onelake.dfs.fabric.microsoft.com/<lakehouseGUID>/Tables/<tableOrSchemaPath>`
     
    Inside the Workspace B Lakehouse UI, right click on the Table and select Properties. Copy the ABFS path value - this should give you the GUID based absolute path. 
     
    Additionally, ensure the notebook always has a Lakehouse attached (even if it is not the source Lakehouse) and that the pipeline identity is granted at least Member/Contributor access to Workspace B and its Lakehouse.
     
    If you can, add a Shortcut in A pointing to B’s table, and then query it with a simple SELECT * FROM schema.table (or the delta path under the shortcut).
     
  • v-aatheeque's avatar
    v-aatheeque
    Community Support

    Hi besab 

    Have you had a chance to look through the responses shared earlier? If anything is still unclear, we’ll be happy to provide additional support.

    • v-aatheeque's avatar
      v-aatheeque
      Community Support

      Hi besab 

      Following up to confirm if the earlier responses addressed your query. If not, please share your questions and we’ll assist further.

  • besab's avatar
    besab
    Frequent Visitor

    Thanks for your answer. We went with the workspace and lakehouse names. The error we got is no longer happening for now.

    • v-aatheeque's avatar
      v-aatheeque
      Community Support

      Hi besab 

      Thank you for sharing the update, and glad to hear the issue is no longer occurring.

      If the solution has resolved your issue, please consider marking it as accepted. This will help other community members facing similar scenarios to find the guidance more easily.