Dear Spark Community,

I’m currently managing a data platform that uses Trino with Hive Metastore
integration. Our Hive Metastore contains a mix of legacy Hive tables and
views, alongside newer views created via Trino.

As expected, Trino stores views in the metastore with viewOriginalText
containing a Base64-encoded JSON blob (e.g., /* Presto View */<base64>).
This format is not directly readable by Spark when using a session with
.enableHiveSupport() and the config spark.sql.hive.convertMetastoreView=true
(or equivalently, spark.enableHive=true), as Spark expects standard SQL
strings in the metastore view definition.

When attempting to read a Trino-created view in Spark, Spark fails because
it cannot parse the encoded format stored by Trino.

My question is:

   -

   Is there any built-in or recommended way to allow Spark to interpret or
   access Trino views within a Spark session using enableHiveSupport()?
   -

   Alternatively, is there any planned support or extension mechanism that
   could allow Spark to decode Trino views at runtime?

Currently, the only workaround is to extract and decode the Base64 manually
in Python or Scala and recreate the view within the session — which is not
scalable in a multi-user, interactive Spark environment.

Would appreciate any guidance, best practices, or roadmap insights related
to this use case.

Best regards.

Reply via email to