Код: Выделить всё
pyspark.errors.exceptions.connect.UnknownException: (org.apache.spark.sql.pipelines.graph.DatasetManager$TableMaterializationException) org.apache.spark.SparkRuntimeException: [LOCATION_ALREADY_EXISTS] Cannot name the managed table as `spark_catalog`.`default`.`basic_mv`, as its associated location 'file:/Users/xxxxx/Spark41/spark-warehouse/basic_mv' already exists. Please pick a different table name, or remove the existing location first. SQLSTATE: 42710
Код: Выделить всё
@sdp.materialized_view(name="basic_mv")
def basic_mv():
"""A simple materialized view transforming the basic_src temporary view."""
sp = _get_spark()
df = sp.table("basic_src")
# Simple transformation: filter and select specific columns
return df.filter(df["val"] == "a").select("id", "val")
Подробнее здесь: https://stackoverflow.com/questions/798 ... lized-view
Мобильная версия