Cross Join for calculation in Spark SQL

后端 未结 3 1097
离开以前
离开以前 2021-01-27 19:37

I have a temporary view with only 1 record/value and I want to use that value to calculate the age of the customers present in another big table (with 100

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-27 20:37

    Hard to work out exactly your point, but if you cannot use Scala or pyspark and dataframes with .cache etc. then I think that instead of of using a temporary view, just create a single row table. My impression is you are using Spark %sql in a notebook on, say, Databricks.

    This is my suspicion as it were.

    That said a broadcastjoin hint may well mean the optimizer only sends out 1 row. See https://jaceklaskowski.gitbooks.io/mastering-spark-sql/content/spark-sql-hint-framework.html#specifying-query-hints

提交回复
热议问题