2026 年 3 月 2 日:使用标准 SQL 子句查询语义视图(正式发布

在 SELECT 语句中使用 SQL 子句查询语义视图的功能现已正式发布,不再处于 预览阶段

您只需在 FROM 子句中指定语义视图的名称,而不是指定 SEMANTIC_VIEW 子句。例如,以下查询指定了 SEMANTIC_VIEW 子句:

SELECT * FROM SEMANTIC_VIEW(
    tpch_analysis
    DIMENSIONS customer.customer_market_segment
    METRICS orders.order_average_value
  )
  ORDER BY customer_market_segment;

以下语句演示了如何在不指定 SEMANTIC_VIEW 子句的情况下执行相同的查询:

SELECT customer_market_segment, AGG(order_average_value)
  FROM tpch_analysis
  GROUP BY customer_market_segment
  ORDER BY customer_market_segment;

有关信息,请参阅 Specifying the name of the semantic view in the FROM clause