예제 #1
0
 def test_group_by_exact_order_expr_desc(self):
     reader = CSVReader(schema, df)
     rs = reader.execute(
         "SELECT COUNT(*) * 5 AS c, married AS m FROM PUMS.PUMS GROUP BY married ORDER BY c DESC"
     )
     assert (rs[1][0] == 549 * 5)
     assert (rs[2][0] == 451 * 5)
예제 #2
0
 def test_empty_result_typed(self):
     reader = CSVReader(schema, df)
     rs = reader.execute("SELECT age as a FROM PUMS.PUMS WHERE age > 100")
     trs = TypedRowset(rs, ['int'], [None])
     assert(len(trs) == 0)
예제 #3
0
 def test_count_exact(self):
     reader = CSVReader(schema, df)
     rs = reader.execute("SELECT COUNT(*) AS c FROM PUMS.PUMS")
     assert (rs[1][0] == 1000)
예제 #4
0
 def test_empty_result(self):
     reader = CSVReader(schema, df)
     rs = reader.execute("SELECT age as a FROM PUMS.PUMS WHERE age > 100")
     print(rs)
     assert(len(rs) == 1)