-
Notifications
You must be signed in to change notification settings - Fork 334
Run Standard.Google in dual JVM mode
#14040
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
Changes from all commits
16125eb
3c0c853
e0d3d7d
144edf2
39fcb8a
2c784af
bc03db6
596e84e
3c12b86
cdbf8fb
a5a588e
c4174e5
677324e
53f1b1a
f289107
de343f3
709807b
95f9f55
1f11d47
05cc641
2a39d26
0b03794
7e69793
638ba98
88c0bd0
125d81b
0285457
c533651
f71e29c
ef75365
ed8e250
ec9abed
1ebffbb
f9f7ef6
2bf4478
1f89021
b1a7022
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 |
|---|---|---|
|
|
@@ -4069,9 +4069,6 @@ lazy val `engine-runner` = project | |
| `database-polyglot-root` | ||
| .listFiles("*.jar") | ||
| .map(_.getAbsolutePath()) ++ | ||
| `google-polyglot-root` | ||
|
Member
Author
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.
|
||
| .listFiles("*.jar") | ||
| .map(_.getAbsolutePath()) ++ | ||
| `std-aws-polyglot-root`.listFiles("*.jar").map(_.getAbsolutePath()) ++ | ||
| `std-snowflake-polyglot-root` | ||
| .listFiles("*.jar") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -615,7 +615,8 @@ impl RunContext { | |
| assert!(old_api_dir.exists()); | ||
| debug!( | ||
| "Checking API for library Standard.{}, its API dir is in {:?}", | ||
| lib.name, old_api_dir | ||
| lib.name, | ||
| self.short_path(&old_api_dir) | ||
| ); | ||
| // `lib_path_in_built_distribution` points to the lib in the `built-distribution` | ||
| // directory, which is not under VCS. We will regenerate the API in this directory | ||
|
|
@@ -640,23 +641,27 @@ impl RunContext { | |
| match diff { | ||
| Ok(_) => Ok(()), | ||
| Err(err) => { | ||
| let suggested_cmd = built_enso | ||
| .cmd()? | ||
| .with_arg("--docs") | ||
| .with_arg("api") | ||
| .with_arg("--in-project") | ||
| .with_arg(lib.path.clone()); | ||
| error!("API check failed for library Standard.{}", lib.name); | ||
| error!("Current API vs Old API: {}", err); | ||
| error!("If you wish to overwrite the current API in the directory {}, run the following command {}, | ||
| error!("If you wish to overwrite the current API in the directory {}, run the following command | ||
| sbt \"runEngineDistribution --no-ir-caches --docs=api --in-project {}\" | ||
|
Member
Author
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. This change, @AdRiley, @GregoryTravis, @jdunkerley, will print: in case of API check failure. Which I can then directly copy and run the regenerator: enso$ sbt "runEngineDistribution --no-ir-caches --docs=api --in-project distribution/lib/Standard/Table/0.0.0-dev"Please note the |
||
| and commit the modified files", | ||
| old_api_dir.display(), | ||
| suggested_cmd.describe() | ||
| self.short_path(&old_api_dir).display(), | ||
| self.short_path(&lib.path).display() | ||
| ); | ||
| bail!("API check failed for library Standard.{}", lib.name); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| fn short_path(&self, full: &Path) -> PathBuf { | ||
| let strip = full.strip_prefix(self.repo_root.path.clone()); | ||
| if let Ok(relative) = strip { | ||
| relative.to_path_buf() | ||
| } else { | ||
| full.to_path_buf() | ||
| } | ||
| } | ||
| } | ||
|
|
||
| #[derive(Debug)] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| from Standard.Base import all | ||
| from Standard.Base.Logging import all | ||
| import Standard.Base.Data.Vector.No_Wrap | ||
| import Standard.Base.Errors.Deprecated.Deprecated | ||
| import Standard.Base.Errors.Illegal_Argument.Illegal_Argument | ||
|
|
@@ -18,6 +19,7 @@ import project.Table.Table | |
| from project.Internal.Table_Type_Helpers import table_from_implementation | ||
|
|
||
| polyglot java import org.enso.table.data.column.DataQualityMetrics | ||
| polyglot java import org.enso.table.data.table.Column as Java_Column | ||
| polyglot java import org.enso.table.data.table.Table as Java_Table | ||
|
|
||
| ## A table whose data is stored in memory. | ||
|
|
@@ -35,9 +37,14 @@ type In_Memory_Table | |
| ## --- | ||
| private: true | ||
| --- | ||
| A getter that is a workaround for bug | ||
| https://github.com/enso-org/enso/issues/12180 | ||
| private java_table self = self.internal_java_table | ||
| A getter that allows one to specify the target Java type and handles | ||
| conversions when needed | ||
| private java_table self table_class=Java_Table column_class=Java_Column = | ||
| raw_table = self.internal_java_table | ||
| if raw_table.is_a table_class then raw_table else | ||
| # coming from the other JVM and deserves conversion | ||
| new_columns = raw_table.getColumns.map c-> column_class.new c.getName c.getStorage | ||
|
Member
Author
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.
|
||
| table_class.new new_columns | ||
|
|
||
| ## --- | ||
| private: true | ||
|
|
@@ -88,7 +95,12 @@ type In_Memory_Table | |
| Helper method for internal use to make a Table from a Java Table. | ||
| from_java_table java_table = | ||
| ## Trigger data quality metrics computation (conditionally on Output context). | ||
| if Context.Output.is_enabled.not then DataQualityMetrics.triggerTable java_table | ||
| if Context.Output.is_enabled.not then | ||
| case java_table of | ||
| _:Java_Table -> | ||
| DataQualityMetrics.triggerTable java_table | ||
| _ -> | ||
| In_Memory_Table.log_message "Cannot compute DataQualityMetrics for "+java_table.to_text | ||
|
|
||
| Table_Refinements.refine_table <| | ||
| In_Memory_Table.Value java_table | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,10 @@ polyglot java import org.enso.table.data.column.builder.LossOfBigDecimalPrecisio | |
| polyglot java import org.enso.table.data.column.builder.LossOfIntegerPrecision | ||
| polyglot java import org.enso.table.data.column.operation.cast.ConversionFailure | ||
| polyglot java import org.enso.table.data.column.operation.cast.ConversionFailureType | ||
|
|
||
| # reflection access to various class methods and fields | ||
| # is being performed on problem classes, hence listing them here | ||
| # so EnsoLibraryFeature registers them for reflection | ||
| polyglot java import org.enso.table.data.table.problems.ArithmeticError | ||
| polyglot java import org.enso.table.data.table.problems.ArithmeticOverflow | ||
| polyglot java import org.enso.table.data.table.problems.FloatingPointGrouping | ||
|
|
@@ -37,31 +41,31 @@ polyglot java import org.enso.table.util.problems.InvalidNames | |
| private: true | ||
| --- | ||
| Convert a Java problem into its Enso equivalent. | ||
| translate_problem p = case p of | ||
| _ : InvalidAggregation -> | ||
| translate_problem p = case p.problemType of | ||
|
Member
Author
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. Introduction of
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. Not sure I like this approach, and wonder if each Problem should be responsible for making an Enso object.
Member
Author
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.
|
||
| "InvalidAggregation" -> | ||
| err = Invalid_Aggregation.Error p.getLocationName (Vector.from_polyglot_array p.getRows) p.getMessage | ||
| Error.throw err | ||
| _ : ArithmeticError -> | ||
| "ArithmeticError" -> | ||
| Arithmetic_Error.Error p.getMessage | ||
| _ : IllegalArgumentError -> | ||
| "IllegalArgumentError" -> | ||
| Illegal_Argument.Error p.getMessage | ||
| _ : IgnoredNaN -> | ||
| "IgnoredNaN" -> | ||
| Ignored_NaN_Values.Warning p.getLocationName (Vector.from_polyglot_array p.getRows) | ||
| _ : IgnoredNothing -> | ||
| "IgnoredNothing" -> | ||
| Ignored_Nothing_Values.Warning p.getLocationName (Vector.from_polyglot_array p.getRows) | ||
| _ : FloatingPointGrouping -> | ||
| "FloatingPointGrouping" -> | ||
| Floating_Point_Equality.Error p.getLocationName | ||
| _ : LossOfIntegerPrecision -> | ||
| "LossOfIntegerPrecision" -> | ||
| Loss_Of_Integer_Precision.Warning p.getAffectedRowsCount p.getExampleValue p.getExampleValueConverted | ||
| _ : LossOfBigDecimalPrecision -> | ||
| "LossOfBigDecimalPrecision" -> | ||
| Loss_Of_Decimal_Precision.Warning p.getAffectedRowsCount (java_to_enso p.getExampleValue) p.getExampleValueConverted | ||
| _ : ArithmeticOverflow -> | ||
| "ArithmeticOverflow" -> | ||
| target_type = Storage.to_value_type p.targetType | ||
| example_operands = case p.exampleOperands of | ||
| Nothing -> Nothing | ||
| array -> Vector.from_polyglot_array array | ||
| Arithmetic_Overflow.Warning target_type p.affectedRowCount example_operands | ||
| _ : ConversionFailure -> | ||
| "ConversionFailure" -> | ||
| examples = Vector.from_polyglot_array p.examples | ||
| target_type = Storage.to_value_type p.targetType | ||
| related_column = p.relatedColumn | ||
|
|
@@ -70,23 +74,23 @@ translate_problem p = case p of | |
| if p.errorType == ConversionFailureType.TEXT_TOO_LONG then Conversion_Failure.Text_Too_Long else | ||
| Conversion_Failure.Error | ||
| constructor target_type related_column affected_rows_count examples | ||
| _ : UnquotedCharactersInOutput -> | ||
| "UnquotedCharactersInOutput" -> | ||
| Unquoted_Characters_In_Output.Warning p.getLocationName (Vector.from_polyglot_array p.getRows) | ||
| _ : UnquotedDelimiter -> | ||
| "UnquotedDelimiter" -> | ||
| Unquoted_Delimiter.Error p.getLocationName (Vector.from_polyglot_array p.getRows) | ||
| _ : InvalidRow -> | ||
| "InvalidRow" -> | ||
| Invalid_Row.Error p.source_row p.table_index (Vector.from_polyglot_array p.row) p.expected_length | ||
| _ : InvalidFixedWidthRow -> | ||
| "InvalidFixedWidthRow" -> | ||
| Invalid_Fixed_Width_Row.Error p.source_line_number p.table_row_number p.line_length p.minimum_line_length | ||
| _ : InconsistentFixedWidthLengths -> | ||
| "InconsistentFixedWidthLengths" -> | ||
| Inconsistent_Fixed_Width_Lengths.Error | ||
| _ : AdditionalInvalidRows -> | ||
| "AdditionalInvalidRows" -> | ||
| Additional_Invalid_Rows.Error p.count | ||
| _ : DuplicateNames -> | ||
| "DuplicateNames" -> | ||
| Duplicate_Output_Column_Names.Error (Vector.from_polyglot_array p.duplicatedNames) | ||
| _ : InvalidNames -> | ||
| "InvalidNames" -> | ||
| Invalid_Column_Names.Error (Vector.from_polyglot_array p.invalidNames) | ||
| _ : InvalidFormat -> | ||
| "InvalidFormat" -> | ||
| Invalid_Format.Error p.column p.expectedEnsoValueType p.count (Vector.from_polyglot_array p.cells) | ||
| _ -> | ||
| Panic.throw (Illegal_Argument.Error "Encountered an unknown problem type when converting Java problems into Enso. This is a bug in the Table library. The unexpected problem was: "+p.to_text) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
With c4174e5 it should be easy to debug
./runexecutable in VSCode with Rust Analyzer:Change the
argslist and press F5, @Akirathan, @4e6. This is a continuation of the effort started in https://github.com/enso-org/enso/pull/14037/files#r2393592162