-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Store example data directly inside the datafusion-examples (#19141) #19319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 4 commits
9e35cfe
6daedb6
6603e3e
591f61c
d77de01
b02e636
7d35fcc
e6b30ac
449f3aa
7dc8a50
fb1af66
396193b
40b1e60
445dbff
2e9e563
0c2dea9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| <!--- | ||
| Licensed to the Apache Software Foundation (ASF) under one | ||
| or more contributor license agreements. See the NOTICE file | ||
| distributed with this work for additional information | ||
| regarding copyright ownership. The ASF licenses this file | ||
| to you under the Apache License, Version 2.0 (the | ||
| "License"); you may not use this file except in compliance | ||
| with the License. You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, | ||
| software distributed under the License is distributed on an | ||
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| KIND, either express or implied. See the License for the | ||
| specific language governing permissions and limitations | ||
| under the License. | ||
| --> | ||
|
|
||
| ## Example datasets | ||
|
|
||
| | Filename | Path | Description | | ||
| | ------------------------ | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| | `cars.csv` | [`data/csv/cars.csv`](./csv/cars.csv) | Time-series–like dataset containing car identifiers, speed values, and timestamps. Used in window function and time-based query examples (e.g. ordering, window frames). | | ||
| | `regex.csv` | [`data/csv/regex.csv`](./csv/regex.csv) | Dataset for regular expression examples. Contains input values, regex patterns, replacement strings, and optional flags. Covers ASCII, Unicode, and locale-specific text processing. | | ||
| | `window_1.csv` | [`data/csv/window_1.csv`](./csv/window_1.csv) | Numeric dataset designed for window function demonstrations. Includes ordering keys and incremental values suitable for running totals, ranking, and frame-based calculations. | | ||
| | `alltypes_plain.parquet` | [`data/parquet/alltypes_plain.parquet`](./parquet/alltypes_plain.parquet) | Parquet file containing columns of many Arrow/DataFusion-supported types (boolean, integers, floating-point, strings, timestamps). Used to demonstrate Parquet scanning, schema inference, and typed execution. | |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| car,speed,time | ||
| red,20.0,1996-04-12T12:05:03.000000000 | ||
| red,20.3,1996-04-12T12:05:04.000000000 | ||
| red,21.4,1996-04-12T12:05:05.000000000 | ||
| red,21.5,1996-04-12T12:05:06.000000000 | ||
| red,19.0,1996-04-12T12:05:07.000000000 | ||
| red,18.0,1996-04-12T12:05:08.000000000 | ||
| red,17.0,1996-04-12T12:05:09.000000000 | ||
| red,7.0,1996-04-12T12:05:10.000000000 | ||
| red,7.1,1996-04-12T12:05:11.000000000 | ||
| red,7.2,1996-04-12T12:05:12.000000000 | ||
| red,3.0,1996-04-12T12:05:13.000000000 | ||
| red,1.0,1996-04-12T12:05:14.000000000 | ||
| red,0.0,1996-04-12T12:05:15.000000000 | ||
| green,10.0,1996-04-12T12:05:03.000000000 | ||
| green,10.3,1996-04-12T12:05:04.000000000 | ||
| green,10.4,1996-04-12T12:05:05.000000000 | ||
| green,10.5,1996-04-12T12:05:06.000000000 | ||
| green,11.0,1996-04-12T12:05:07.000000000 | ||
| green,12.0,1996-04-12T12:05:08.000000000 | ||
| green,14.0,1996-04-12T12:05:09.000000000 | ||
| green,15.0,1996-04-12T12:05:10.000000000 | ||
| green,15.1,1996-04-12T12:05:11.000000000 | ||
| green,15.2,1996-04-12T12:05:12.000000000 | ||
| green,8.0,1996-04-12T12:05:13.000000000 | ||
| green,2.0,1996-04-12T12:05:14.000000000 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| values,patterns,replacement,flags | ||
| abc,^(a),bb\1bb,i | ||
| ABC,^(A).*,B,i | ||
| aBc,(b|d),e,i | ||
| AbC,(B|D),e, | ||
| aBC,^(b|c),d, | ||
| 4000,\b4([1-9]\d\d|\d[1-9]\d|\d\d[1-9])\b,xyz, | ||
| 4010,\b4([1-9]\d\d|\d[1-9]\d|\d\d[1-9])\b,xyz, | ||
| Düsseldorf,[\p{Letter}-]+,München, | ||
| Москва,[\p{L}-]+,Moscow, | ||
| Köln,[a-zA-Z]ö[a-zA-Z]{2},Koln, | ||
| اليوم,^\p{Arabic}+$,Today, |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| ts,inc_col,desc_col | ||
| 1,1,100 | ||
| 1,5,98 | ||
| 5,10,93 | ||
| 9,15,91 | ||
| 10,20,86 | ||
| 11,21,84 | ||
| 16,26,81 | ||
| 21,29,77 | ||
| 22,30,75 | ||
| 26,33,71 | ||
| 26,37,70 | ||
| 28,40,69 | ||
| 31,43,64 | ||
| 33,44,62 | ||
| 38,45,59 | ||
| 42,49,55 | ||
| 47,51,50 | ||
| 51,53,45 | ||
| 53,58,41 | ||
| 53,61,40 | ||
| 58,65,39 | ||
| 63,70,36 | ||
| 67,75,31 | ||
| 68,78,28 | ||
| 70,83,23 | ||
| 72,88,22 | ||
| 72,90,17 | ||
| 76,91,13 | ||
| 81,95,10 | ||
| 85,97,6 | ||
| 86,100,5 | ||
| 88,105,2 | ||
| 91,109,1 | ||
| 96,111,-1 | ||
| 97,115,-4 | ||
| 98,119,-5 | ||
| 100,120,-6 | ||
| 101,124,-8 | ||
| 102,126,-12 | ||
| 104,129,-16 | ||
| 104,131,-17 | ||
| 108,135,-19 | ||
| 112,140,-24 | ||
| 113,143,-25 | ||
| 113,144,-29 | ||
| 114,147,-34 | ||
| 114,148,-37 | ||
| 117,149,-42 | ||
| 122,151,-47 | ||
| 126,155,-48 | ||
| 131,156,-49 | ||
| 131,159,-53 | ||
| 136,160,-57 | ||
| 136,163,-58 | ||
| 136,165,-61 | ||
| 139,170,-65 | ||
| 141,172,-67 | ||
| 146,177,-68 | ||
| 147,181,-71 | ||
| 147,182,-73 | ||
| 152,186,-75 | ||
| 154,187,-76 | ||
| 159,192,-78 | ||
| 161,196,-83 | ||
| 163,197,-87 | ||
| 164,199,-91 | ||
| 167,203,-95 | ||
| 172,207,-98 | ||
| 173,209,-101 | ||
| 177,213,-105 | ||
| 180,214,-106 | ||
| 185,216,-111 | ||
| 186,219,-114 | ||
| 191,221,-116 | ||
| 195,222,-120 | ||
| 195,225,-125 | ||
| 199,226,-128 | ||
| 203,231,-129 | ||
| 207,236,-134 | ||
| 210,237,-139 | ||
| 213,242,-142 | ||
| 218,245,-143 | ||
| 221,247,-146 | ||
| 224,248,-150 | ||
| 226,253,-154 | ||
| 230,254,-158 | ||
| 232,259,-163 | ||
| 235,261,-168 | ||
| 238,266,-172 | ||
| 238,269,-176 | ||
| 239,272,-181 | ||
| 244,275,-184 | ||
| 245,278,-189 | ||
| 247,283,-193 | ||
| 250,286,-196 | ||
| 254,289,-201 | ||
| 258,291,-203 | ||
| 262,296,-208 | ||
| 264,301,-210 | ||
| 264,305,-213 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,7 @@ use datafusion::logical_expr::{col, lit}; | |
| use datafusion::parquet::encryption::decrypt::FileDecryptionProperties; | ||
| use datafusion::parquet::encryption::encrypt::FileEncryptionProperties; | ||
| use datafusion::prelude::{ParquetReadOptions, SessionContext}; | ||
| use std::path::PathBuf; | ||
| use std::sync::Arc; | ||
| use tempfile::TempDir; | ||
|
|
||
|
|
@@ -32,13 +33,14 @@ pub async fn parquet_encrypted() -> datafusion::common::Result<()> { | |
| // The SessionContext is the main high level API for interacting with DataFusion | ||
| let ctx = SessionContext::new(); | ||
|
|
||
| // Find the local path of "alltypes_plain.parquet" | ||
| let testdata = datafusion::test_util::parquet_test_data(); | ||
| let filename = &format!("{testdata}/alltypes_plain.parquet"); | ||
| let path = PathBuf::from(env!("CARGO_MANIFEST_DIR")) | ||
|
||
| .join("data") | ||
| .join("parquet") | ||
| .join("alltypes_plain.parquet"); | ||
|
|
||
| // Read the sample parquet file | ||
| let parquet_df = ctx | ||
| .read_parquet(filename, ParquetReadOptions::default()) | ||
| .read_parquet(path.to_str().unwrap(), ParquetReadOptions::default()) | ||
| .await?; | ||
|
|
||
| // Show information from the dataframe | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid copying the
alltypes-plainexample file too? That likely is also just some arbitrary choice of file in the example that could be rewritten to something more useful