-
Notifications
You must be signed in to change notification settings - Fork 336
Tableau Dual JVM tweaks #14631
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
jdunkerley
wants to merge
47
commits into
develop
Choose a base branch
from
wip/jd/tableau-dual
base: develop
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.
+1,387
−1,376
Open
Tableau Dual JVM tweaks #14631
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
c44b65c
Widget for `File.new`.
jdunkerley e1d6ef2
Remove passing the Table object and use names and storages.
jdunkerley f1c3308
Fix missed changes.
jdunkerley c8c6ef2
Deal with one more place where null.
jdunkerley 87b24be
PR comments.
jdunkerley f01e860
PR comments (2).
jdunkerley b421f59
Isolate the make local for StorageType into the interface itself.
jdunkerley cc65b60
Missing imports.
jdunkerley 4e6546c
Whitespace
jdunkerley 94008cd
Ensure inferPreciseType returns a local StorageType.
jdunkerley 21531b9
Java format.
jdunkerley 6410cbd
Move the polyglot materialisation to TypedStorage.
jdunkerley eb028f0
Debug the world
jdunkerley 54ad38f
Fix compile error.
jdunkerley b767e37
Getting back to it.
jdunkerley 47d0b21
Last bit of tidying.
jdunkerley 9b1e80f
Docs
jdunkerley a6d78b1
Type fix.
jdunkerley 529f04c
Fixes.
jdunkerley d9c8b08
Remove some more helper methods and move to using ColumnStorages when…
jdunkerley f6315a6
Wrong method name.
jdunkerley f75a771
Missed a rename or two.
jdunkerley 37f82a0
Fix is_dry_run change.
jdunkerley fc65c90
Explicitly localise in HyperFormat.
jdunkerley 970a499
Java format.
jdunkerley 3ed64fe
Remove `getType` in favour of a static method which will ensure Stora…
jdunkerley 2774c95
Part 2 for StorageType.ofStorage.
jdunkerley ef1be16
Part 3 for StorageType.ofStorage.
jdunkerley 770f247
Part 4 for StorageType.ofStorage.
jdunkerley b4def16
Part 5 for StorageType.ofStorage.
jdunkerley 85198cb
Part 6 for StorageType.ofStorage.
jdunkerley ba55fcd
And more...
jdunkerley 645c7d3
And more...
jdunkerley 78cacaa
Some cleaning.
jdunkerley ecabc4d
Fix defects.
jdunkerley 5f683a9
Fix defects (2).
jdunkerley 2de302c
Remove unused methods and move to storage not column to make a new ta…
jdunkerley 3990bb2
Java format.
jdunkerley 906f432
Fix issue with LongBuilder
jdunkerley f6d2929
Sort BigInteger in JVM mode.
jdunkerley d346511
Sort failing tests.
jdunkerley fbf3ab9
More to do but trying some ways to get it to work
jdunkerley 8cf1a0d
Working on Builder
jdunkerley 17d5765
Fixes.
jdunkerley f971bf3
Merged
jdunkerley e5563ae
Not sure if I need to do the conversion in the valueAsType methods bu…
jdunkerley 52f7d95
Close to all working...
jdunkerley 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
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
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
3 changes: 3 additions & 0 deletions
3
distribution/lib/Standard/Table/0.0.0-dev/docs/api/Internal/In_Memory_Helpers.md
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 |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| ## Enso Signatures 1.0 | ||
| ## module Standard.Table.Internal.In_Memory_Helpers | ||
| - get_java_column_storages table:Standard.Table.In_Memory_Table.In_Memory_Table -> (Standard.Base.Data.Vector.Vector Standard.Table.Internal.In_Memory_Helpers.Java_ColumnStorage) | ||
3 changes: 0 additions & 3 deletions
3
...bution/lib/Standard/Table/0.0.0-dev/docs/api/Internal/In_Memory_Test_Helpers.md
This file was deleted.
Oops, something went wrong.
7 changes: 1 addition & 6 deletions
7
distribution/lib/Standard/Table/0.0.0-dev/docs/api/Internal/Java_Exports.md
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 |
|---|---|---|
| @@ -1,10 +1,5 @@ | ||
| ## Enso Signatures 1.0 | ||
| ## module Standard.Table.Internal.Java_Exports | ||
| - make_bool_builder initial_size:Standard.Base.Any.Any -> Standard.Base.Any.Any | ||
| - make_builder_for_type value_type:Standard.Base.Any.Any initial_size:Standard.Base.Any.Any java_problem_aggregator:Standard.Base.Any.Any= -> Standard.Base.Any.Any | ||
| - make_column_from_java_column -> Standard.Base.Any.Any | ||
| - make_column_from_storage -> Standard.Base.Any.Any | ||
| - make_double_builder initial_size:Standard.Base.Any.Any java_problem_aggregator:Standard.Base.Any.Any= -> Standard.Base.Any.Any | ||
| - make_inferred_builder initial_size:Standard.Base.Any.Any java_problem_aggregator:Standard.Base.Any.Any= -> Standard.Base.Any.Any | ||
| - make_long_builder initial_size:Standard.Base.Any.Any bits:Standard.Base.Any.Any java_problem_aggregator:Standard.Base.Any.Any= -> Standard.Base.Any.Any | ||
| - make_string_builder initial_size:Standard.Base.Any.Any value_type:Standard.Base.Any.Any= -> Standard.Base.Any.Any | ||
| - make_string_builder initial_size:Standard.Base.Any.Any value_type:Standard.Table.Value_Type.Value_Type= -> Standard.Base.Any.Any |
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
13 changes: 13 additions & 0 deletions
13
distribution/lib/Standard/Table/0.0.0-dev/src/Internal/In_Memory_Helpers.enso
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 |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import Standard.Base.Data.Vector.Vector | ||
JaroslavTulach marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| import project.In_Memory_Table.In_Memory_Table | ||
|
|
||
| polyglot java import org.enso.table.data.column.storage.ColumnStorage as Java_ColumnStorage | ||
|
|
||
| ## --- | ||
| private: true | ||
| --- | ||
| Gets the Java ColumnStorage object from an In_Memory_Table. | ||
| get_java_column_storages (table : In_Memory_Table) -> Vector Java_ColumnStorage = | ||
| java_columns = table.java_table.getColumns | ||
| java_columns.map c->c.getStorage | ||
9 changes: 0 additions & 9 deletions
9
distribution/lib/Standard/Table/0.0.0-dev/src/Internal/In_Memory_Test_Helpers.enso
This file was deleted.
Oops, something went wrong.
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
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
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 |
|---|---|---|
|
|
@@ -10,9 +10,9 @@ import Standard.Base.System.Input_Stream.Input_Stream | |
| from Standard.Base.Metadata.Choice import Option | ||
|
|
||
| import Standard.Table.In_Memory_Table.In_Memory_Table | ||
| import Standard.Table.Internal.In_Memory_Helpers | ||
| from Standard.Table import Table | ||
| from Standard.Table.Errors import Unmatched_Columns | ||
| from Standard.Table.In_Memory_Table import to_java_table | ||
| from Standard.Table.Match_Columns import Match_Columns | ||
|
|
||
| import project.Hyper_Errors | ||
|
|
@@ -21,8 +21,6 @@ import project.Internal.Telemetry | |
| from project.Hyper_Errors import Hyper_Unsupported_Type | ||
|
|
||
| polyglot java import org.enso.tableau.HyperFormat | ||
| polyglot java import org.enso.table.data.table.Column as Java_Column | ||
| polyglot java import org.enso.table.data.table.Table as Java_Table | ||
|
|
||
| ## Read the file to a `Hyper_File` object. | ||
| type Tableau_Format | ||
|
|
@@ -114,26 +112,30 @@ type Tableau_Format | |
| --- | ||
| Implements the `Table.write` for this `File_Format`. | ||
| write_table self file:Writable_File table:Table on_existing_file match_columns:Match_Columns on_problems:Problem_Behavior = | ||
| if table.is_a In_Memory_Table . not then Error.throw (Type_Error.Error "Tableau format only supports writing In-Memory tables. Use `read` to materialize the table first.") | ||
|
|
||
| _check_supported_types table | ||
| if (on_existing_file == Existing_File_Behavior.Error) && file.exists then Error.throw (File_Error.Already_Exists file) else | ||
| is_dry_run = Context.Output.is_enabled.not | ||
| resolved_file = if is_dry_run then (file.file.create_dry_run_file copy_original=True).path else file.file.path | ||
|
|
||
| needs_backup = on_existing_file == Existing_File_Behavior.Backup && is_dry_run.not | ||
| if needs_backup && file.exists then | ||
| backup_file = _find_bak_file file.file | ||
| Panic.rethrow <| file.file.copy_to backup_file replace_existing=True | ||
|
|
||
| resolved_schema = if self.schema == "*" then "Extract" else self.schema | ||
| resolved_table = case self of | ||
| Tableau_Format.Hyper_Table _ t -> t | ||
| _ -> "Extract" | ||
| warning_unmatched_columns = Hyper_Errors.handle_java_exceptions <| | ||
| java_table = to_java_table table:In_Memory_Table Java_Table Java_Column | ||
| HyperFormat.writeTable resolved_file resolved_schema resolved_table java_table (on_existing_file == Existing_File_Behavior.Append) (match_columns == Match_Columns.By_Name) (on_problems == Problem_Behavior.Report_Error) | ||
| problems = if warning_unmatched_columns.length > 0 then [Unmatched_Columns.Error warning_unmatched_columns.to_vector] else [] | ||
| on_problems.attach_problems_before problems <| | ||
| File.new resolved_file | ||
| if (on_existing_file == Existing_File_Behavior.Error) && file.exists then Error.throw (File_Error.Already_Exists file) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| resolved_file = if Context.Output.is_enabled then file.file.path else (file.file.create_dry_run_file copy_original=True).path | ||
|
|
||
| needs_backup = on_existing_file == Existing_File_Behavior.Backup && Context.Output.is_enabled | ||
| if needs_backup && file.exists then | ||
| backup_file = _find_bak_file file.file | ||
| Panic.rethrow <| file.file.copy_to backup_file replace_existing=True | ||
|
|
||
| resolved_schema = if self.schema == "*" then "Extract" else self.schema | ||
| resolved_table = case self of | ||
| Tableau_Format.Hyper_Table _ t -> t | ||
| _ -> "Extract" | ||
|
|
||
| column_storages = In_Memory_Helpers.get_java_column_storages table:In_Memory_Table | ||
| warning_unmatched_columns = Hyper_Errors.handle_java_exceptions <| | ||
| HyperFormat.writeTable resolved_file resolved_schema resolved_table table.column_names column_storages (on_existing_file == Existing_File_Behavior.Append) (match_columns == Match_Columns.By_Name) (on_problems == Problem_Behavior.Report_Error) | ||
|
|
||
| problems = if warning_unmatched_columns.length > 0 then [Unmatched_Columns.Error warning_unmatched_columns.to_vector] else [] | ||
| on_problems.attach_problems_before problems <| | ||
| File.new resolved_file | ||
|
|
||
| private _check_supported_types table:Table = | ||
| f = table.columns.filter c->c.value_type.is_mixed | ||
|
|
||
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
Oops, something went wrong.
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.