PiotrAndrzejewsky commented on code in PR #14637:
URL: https://github.com/apache/gravitino/pull/14637#discussion_r4491686481
##########
docs/manage-view-metadata-using-gravitino.md:
##########
@@ -72,6 +72,36 @@ View view = views.createView(
ImmutableMap.of());
```
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+catalog = client.load_catalog("sales")
+views = catalog.as_view_catalog()
+
+columns = [
+ Column.of("id", Types.IntegerType.get(), nullable=False),
+ Column.of("name", Types.VarCharType.of(500)),
+]
+
+representations = [
+ SQLRepresentation(
+ Dialects.SPARK,
+ "SELECT * FROM customers WHERE last_order_at > current_date - interval
365 day",
+ )
+]
+
+view = views.create_view(
+ NameIdentifier.of("public", "active_customers"),
+ columns=columns,
+ representations=representations,
+ comment="Customers with orders in the last year",
+ default_catalog="sales",
+ default_schema="public",
+ properties={},
Review Comment:
Fixed! Added "spark.sql.create.version": "3.5.0" to the property map across
the REST, Java, and Python view creation examples.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]