-
Notifications
You must be signed in to change notification settings - Fork 139
feat: Add CDF tracing for Phase 1 of Change Data feed #1654
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
Open
lorenarosati
wants to merge
40
commits into
delta-io:main
Choose a base branch
from
lorenarosati:cdf-tracing
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 30 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
936f6f2
tracing changes
lorenarosati 51c1b11
Merge branch 'main' into table-config-tracing
lorenarosati b311f15
added testing
lorenarosati 8a6ca27
Merge branch 'table-config-tracing' of github.com:lorenarosati/delta-…
lorenarosati 05cfdbe
changes
lorenarosati 563130a
changed everything to delta serialization format
lorenarosati 4842e50
Merge branch 'main' into table-config-tracing
lorenarosati 143749c
formatting
lorenarosati 244d62a
Merge branch 'table-config-tracing' of github.com:lorenarosati/delta-…
lorenarosati fd341be
use serial_test crate so traced tests dont run at same time as others
lorenarosati 162e710
removed serial
lorenarosati 30a7f84
replaced tracing-test crate with using tracing-subscriber with a test…
lorenarosati cc2446c
fixed custom writer
lorenarosati fcf241f
removed subscriber from wrong test
lorenarosati da7e2be
moved file writer
lorenarosati b29b946
fixing code cov
lorenarosati ba191f3
Merge branch 'main' into table-config-tracing
lorenarosati 5b46ce5
fix
lorenarosati 0193410
Merge branch 'table-config-tracing' of github.com:lorenarosati/delta-…
lorenarosati e28f03f
fix
lorenarosati afa0c2f
removed comment
lorenarosati 87fae6a
Merge branch 'main' into table-config-tracing
lorenarosati 5a7a8b3
Merge branch 'main' into table-config-tracing
lorenarosati a938d4d
moved logwriter to test-utils
lorenarosati bf5efe5
Merge branch 'main' into table-config-tracing
lorenarosati 7323bf0
added tracing statemnets
lorenarosati c4867c2
Merge branch 'main' into cdf-tracing
lorenarosati 3b07816
Merge branch 'main' into cdf-tracing
lorenarosati 6251ec3
quick fix w timestamp variable
lorenarosati 0b3a3d4
Merge branch 'cdf-tracing' of github.com:lorenarosati/delta-kernel-rs…
lorenarosati a0ecd22
added logging test set up
lorenarosati abd5371
added test for cdc action=true
lorenarosati 4aa9449
added test for deletion vector
lorenarosati 25d8f33
dv test
lorenarosati 652f717
added id to trace
lorenarosati 76536ad
Merge branch 'main' into cdf-tracing
lorenarosati b99c00d
Merge branch 'main' into cdf-tracing
lorenarosati 80b924d
added default to pass test
lorenarosati e3f1c7e
quick fix
lorenarosati 800365d
Merge branch 'main' into cdf-tracing
lorenarosati File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -992,3 +992,73 @@ async fn print_table_configuration() { | |
| assert!(log_output.contains("\"delta.columnMapping.mode\": \"none\"")); | ||
| assert!(log_output.contains("\"delta.enableDeletionVectors\": \"true\"")); | ||
| } | ||
|
|
||
| #[tokio::test] | ||
| async fn print_table_info_post_phase1() { | ||
| let logs = Arc::new(Mutex::new(Vec::new())); | ||
| let logs_clone = logs.clone(); | ||
|
|
||
| let subscriber = tracing_subscriber::registry().with( | ||
| tracing_subscriber::fmt::layer() | ||
| .with_writer(move || LogWriter(logs_clone.clone())) | ||
| .with_ansi(false), | ||
| ); | ||
|
|
||
| let _guard = tracing::subscriber::set_default(subscriber); | ||
|
||
|
|
||
| let engine = Arc::new(SyncEngine::new()); | ||
| let mut mock_table = LocalMockTable::new(); | ||
| // This specific commit (with these actions) isn't necessary to test the tracing, we just need to have one commit with any actions | ||
| mock_table | ||
| .commit([ | ||
| Action::Metadata( | ||
| Metadata::try_new( | ||
| None, | ||
| None, | ||
| get_schema(), | ||
| vec![], | ||
| 0, | ||
| HashMap::from([ | ||
| ("delta.enableChangeDataFeed".to_string(), "true".to_string()), | ||
| ( | ||
| "delta.enableDeletionVectors".to_string(), | ||
| "true".to_string(), | ||
| ), | ||
| ("delta.columnMapping.mode".to_string(), "none".to_string()), | ||
| ]), | ||
| ) | ||
| .unwrap(), | ||
| ), | ||
| Action::Protocol( | ||
| Protocol::try_new( | ||
| 3, | ||
| 7, | ||
| Some([TableFeature::DeletionVectors]), | ||
| Some([TableFeature::DeletionVectors, TableFeature::ChangeDataFeed]), | ||
| ) | ||
| .unwrap(), | ||
| ), | ||
| ]) | ||
| .await; | ||
|
|
||
| let commits = get_segment(engine.as_ref(), mock_table.table_root(), 0, None) | ||
| .unwrap() | ||
| .into_iter(); | ||
|
|
||
| let table_root_url = url::Url::from_directory_path(mock_table.table_root()).unwrap(); | ||
| let table_config = get_default_table_config(&table_root_url); | ||
|
|
||
| let _scan_batches: DeltaResult<Vec<_>> = | ||
| table_changes_action_iter(engine, &table_config, commits, get_schema().into(), None) | ||
| .unwrap() | ||
| .try_collect(); | ||
|
|
||
| let log_output = String::from_utf8(logs.lock().unwrap().clone()).unwrap(); | ||
|
|
||
| assert!(log_output.contains("Phase 1 of CDF query processing completed")); | ||
| assert!(log_output.contains("remove_dvs_size=0")); | ||
lorenarosati marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| assert!(log_output.contains("has_cdc_action=false")); | ||
lorenarosati marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| assert!(log_output.contains("file_path=")); | ||
| assert!(log_output.contains("version=0")); | ||
| assert!(log_output.contains("timestamp=")); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.