-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8edcd27
commit ad8449f
Showing
6 changed files
with
75 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
hoptimator-catalog/src/test/java/com/linkedin/hoptimator/catalog/DataTypeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.linkedin.hoptimator.catalog; | ||
|
||
import org.apache.calcite.rel.type.RelDataType; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
import org.junit.Test; | ||
|
||
public class DataTypeTest { | ||
|
||
@Test | ||
public void skipsNestedRows() { | ||
DataType.Struct struct = DataType.struct().with("one", DataType.VARCHAR) | ||
.with("two", DataType.struct().with("three", DataType.VARCHAR)); | ||
RelDataType row1 = struct.rel(); | ||
assertTrue(row1.toString(), row1.getFieldCount() == 2); | ||
assertTrue(row1.toString(), row1.getField("one", false, false) != null); | ||
assertTrue(row1.toString(), row1.getField("two", false, false) != null); | ||
RelDataType row2 = struct.dropNestedRows().rel(); | ||
assertTrue(row2.toString(), row2.getFieldCount() == 1); | ||
assertTrue(row2.toString(), row2.getField("one", false, false) != null); | ||
assertTrue(row2.toString(), row2.getField("two", false, false) == null); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters