Spaces:
Sleeping
Sleeping
Upload main.py with huggingface_hub
Browse files
main.py
CHANGED
|
@@ -95,12 +95,12 @@ def startup():
|
|
| 95 |
mode = "remote httpfs" if is_remote else "local files"
|
| 96 |
print(f"Data mode: {mode}")
|
| 97 |
|
| 98 |
-
#
|
| 99 |
-
# No data copied into RAM — DuckDB fetches only needed columns/rows per query.
|
| 100 |
db.execute(f"""
|
| 101 |
-
CREATE
|
| 102 |
SELECT * FROM read_parquet('{results_src}')
|
| 103 |
""")
|
|
|
|
| 104 |
db.execute(f"""
|
| 105 |
CREATE VIEW features AS
|
| 106 |
SELECT * FROM read_parquet('{features_src}')
|
|
|
|
| 95 |
mode = "remote httpfs" if is_remote else "local files"
|
| 96 |
print(f"Data mode: {mode}")
|
| 97 |
|
| 98 |
+
# Results: loaded into memory (47MB — small, queried on every page load)
|
|
|
|
| 99 |
db.execute(f"""
|
| 100 |
+
CREATE TABLE results AS
|
| 101 |
SELECT * FROM read_parquet('{results_src}')
|
| 102 |
""")
|
| 103 |
+
# Features: remote view (only fetched on demand for feature deep dives)
|
| 104 |
db.execute(f"""
|
| 105 |
CREATE VIEW features AS
|
| 106 |
SELECT * FROM read_parquet('{features_src}')
|