Skip to content

Commit 15cd95c

Browse files
committed
MLE-151 Added test for sys_tables query
1 parent 235d417 commit 15cd95c

File tree

1 file changed

+13
-0
lines changed
  • marklogic-spark-connector/src/test/java/com/marklogic/spark/reader/optic

1 file changed

+13
-0
lines changed

marklogic-spark-connector/src/test/java/com/marklogic/spark/reader/optic/ReadRowsTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,19 @@ void validPartitionCountAndBatchSize() {
4545
});
4646
}
4747

48+
@Test
49+
void sysTables() {
50+
Dataset<Row> dataset = newDefaultReader()
51+
.option(Options.READ_OPTIC_QUERY, "op.fromView('sys','sys_tables')")
52+
.load();
53+
54+
ConnectorException ex = assertThrows(ConnectorException.class, dataset::count);
55+
assertTrue(ex.getMessage().contains("TDE-INVALIDVIEWNAME"), "MLE-151 captures a bug where internal/viewinfo " +
56+
"does not work for sys/sys_tables. This is capturing that behavior, though we may end up closing the bug " +
57+
"as 'not supported'. The main use case is that it can be helpful in an environment like PySpark to quickly " +
58+
"learn what views exist for a database.");
59+
}
60+
4861
@Test
4962
void emptyQualifier() {
5063
List<Row> rows = newDefaultReader()

0 commit comments

Comments
 (0)