summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_drill.py
blob: 634c247d602e4d977ee8006f71d6bd157f7ddeed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from tests.dialects.test_dialect import Validator


class TestDrill(Validator):
    dialect = "drill"

    def test_drill(self):
        self.validate_identity(
            "SELECT * FROM table(dfs.`test_data.xlsx`(type => 'excel', sheetName => 'secondSheet'))"
        )
        self.validate_identity(
            "SELECT * FROM (SELECT * FROM t) PIVOT(avg(c1) AS ac1 FOR c2 IN ('V' AS v))",
        )

        self.validate_all(
            "SELECT '2021-01-01' + INTERVAL 1 MONTH",
            write={
                "drill": "SELECT '2021-01-01' + INTERVAL '1' MONTH",
                "mysql": "SELECT '2021-01-01' + INTERVAL '1' MONTH",
            },
        )