Skip to content

Commit

Permalink
fix regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
seawinde committed Oct 25, 2024
1 parent 91dd9e8 commit 623354c
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,22 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
import org.junit.Assert;
suite("test_cte_with_duplicate_consumer") {
test {
try {
sql """
WITH cte1(col1) AS (SELECT 1), cte2(col2_1, col2_2) AS (SELECT col1, col1 FROM cte1) SELECT * FROM cte2
"""
} catch (Exception e) {
// Duplicated inline view column alias: 'col1' in inline view: 'cte2''
assertTrue(e.message.contains(" Duplicated inline view column alias"))
}

test {
sql """
WITH cte1(col1) AS (SELECT 1), cte2(col2_1) AS (SELECT col1 FROM cte1) SELECT * FROM cte2
"""

result([[1, 1]])
result([[1]])
}
}

0 comments on commit 623354c

Please sign in to comment.