1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""
Regression test for issue #1387: sql.show_tables parity.
PySpark scenario (from the issue):
def scenario_sql_show_tables(session):
return session.sql("SHOW TABLES")
This test exercises the same scenario against sparkless, ensuring that:
- ``session.sql("SHOW TABLES")`` does not raise.
- The resulting schema's ``simpleString()`` matches the current struct form.
- The data includes at least the default namespace and respects the existing
sparkless column naming.
- ``explain()`` returns a non-empty plan string (no blank UI).
"""
"""sql.show_tables: schema, basic data, and explain behavior (issue #1387)."""
=
=
# Schema simpleString should match the current struct representation.
# Sparkless today uses `database` rather than PySpark's `namespace`.
=
assert
# Data: content may vary by environment (e.g., empty catalog vs. pre-populated),
# so we only assert that the query returns a DataFrame and do not require a
# specific database name.
=
assert
# explain() should produce a non-empty plan string.
=
assert
assert !=