From 0bfc80f4f47d17ad793fbbc60c50dd2fea7db100 Mon Sep 17 00:00:00 2001 From: Selena Chen Date: Wed, 16 Oct 2024 14:46:27 -0700 Subject: [PATCH] Add test for day level granularity --- .../SetTableReplicationPolicyStatementTest.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/integrations/spark/openhouse-spark-itest/src/test/java/com/linkedin/openhouse/spark/statementtest/SetTableReplicationPolicyStatementTest.java b/integrations/spark/openhouse-spark-itest/src/test/java/com/linkedin/openhouse/spark/statementtest/SetTableReplicationPolicyStatementTest.java index 80ef8dac..99c6cbf9 100644 --- a/integrations/spark/openhouse-spark-itest/src/test/java/com/linkedin/openhouse/spark/statementtest/SetTableReplicationPolicyStatementTest.java +++ b/integrations/spark/openhouse-spark-itest/src/test/java/com/linkedin/openhouse/spark/statementtest/SetTableReplicationPolicyStatementTest.java @@ -195,6 +195,22 @@ public void testReplicationPolicyWithoutProperSyntax() { "ALTER TABLE openhouse.db.table SET POLICY (REPLICATION = ({cluster: 'aa', interval: '12'}))") .show()); + Assertions.assertThrows( + OpenhouseParseException.class, + () -> + spark + .sql( + "ALTER TABLE openhouse.db.table SET POLICY (REPLICATION = ({cluster: 'aa', interval: '1D'}))") + .show()); + + Assertions.assertThrows( + OpenhouseParseException.class, + () -> + spark + .sql( + "ALTER TABLE openhouse.db.table SET POLICY (REPLICATION = ({cluster: 'aa', interval: '12d'}))") + .show()); + // Missing cluster and interval values Assertions.assertThrows( OpenhouseParseException.class,