Attila Turoczy created HIVE-29790:
-------------------------------------

             Summary: Semantic View for Apache Hive
                 Key: HIVE-29790
                 URL: https://issues.apache.org/jira/browse/HIVE-29790
             Project: Hive
          Issue Type: New Feature
          Components: HiveServer2
            Reporter: Attila Turoczy


A Semantic View provides a reusable semantic layer on top of Hive tables and 
views. It allows commonly used business metrics and dimensions to be defined 
once and consistently reused across queries. Open functionality for LLM's to 
get the context in a right way.

 

For example, different teams may independently define metrics such as:
 * Total revenue
 * Order count
 * Average order value
 * Active customer count

Conceptual example:

{{CREATE SEMANTIC VIEW sales_semantic_view
ON TABLE sales}}

{{DIMENSIONS (}}
{{date AS order_date,}}
{{  ctry AS country,}}
{{  product_category AS category,}}
{{c_id AS customer_id
)}}

{{METRICS (}}
total_revenue AS SUM(quantity * unit_price),
order_count AS COUNT(DISTINCT order_id),
customer_count AS COUNT(DISTINCT customer_id),
average_order_value AS SUM(quantity * unit_price) / COUNT(DISTINCT order_id)
);

A query could then reference the semantic definitions without repeating their 
implementation:

{{SELECT
  country,
  total_revenue,
  order_count
FROM sales_semantic_view
GROUP BY country;}}

{{}}

The initial implementation should support operations equivalent to:

 
 * {{CREATE SEMANTIC VIEW}}
 * {{ALTER SEMANTIC VIEW}}
 * {{DROP SEMANTIC VIEW}}
 * {{DESCRIBE SEMANTIC VIEW}}
 * {{SHOW SEMANTIC VIEWS}}
 * {{{}SHOW CREATE SEMANTIC VIEW{}}}{{{}{}}}

[https://ossie.apache.org/] 

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to