-
Notifications
You must be signed in to change notification settings - Fork 323
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
Reworking Excel support to allow for reading of big files #8403
Conversation
89ff416
to
2289c62
Compare
@@ -2717,11 +2717,12 @@ val allStdBits: Parser[String] = | |||
lazy val `simple-httpbin` = project | |||
.in(file("tools") / "simple-httpbin") | |||
.settings( | |||
frgaalJavaCompilerSetting, |
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.
The frgaal compiler settings have been causing compile error:
cannot find symbol import com.sun.net.httpserver.SimpleFileServer: cannot find symbol
.
Apparently SimpleFileServer
may not be in the JDK that Frgaal uses? Weird.
Anyway there is no benefit in Frgaal within this sub-project, especially as we are already on JDK21. Removing it allowed me to re-use the SimpleFileServer
for serving files for testing, instead of having to roll my own solution or having to bring in some heavy dependencies.
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.
Frgaal by default only exposes only classes that are in API of the JDK. SimpleFileServer
isn't.
no benefit in Frgaal within this sub-project
There is a benefit. It already prevented you from using SimpleFileServer
!
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.
Frgaal by default only exposes only classes that are in API of the JDK.
SimpleFileServer
isn't.no benefit in Frgaal within this sub-project
There is a benefit. It already prevented you from using
SimpleFileServer
!
I really honestly don't understand. HOW is that a benefit?
Without Frgaal the server is running fine on our JDK. What is the benefit of using it this translation layer at this point?
We introduced it to be able to use newer features before we migrated to the newer JDKs. But now we have these features natively, so what else?
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.
server is running fine on our JDK.
You have compiled your code in a way that allows running it on JDK 11. However your code cannot run on JDK 11. Without Frgaal you wouldn't even notice that your project is misconfigured as it requires JDK18+ to run.
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.
server is running fine on our JDK.
You have compiled your code in a way that allows running it on JDK 11. However your code cannot run on JDK 11. Without Frgaal you wouldn't even notice that your project is misconfigured as it requires JDK18+ to run.
Hm, I see. It was hard to appreciate that, because from my perspective, removing Frgaal made it work - I never really specifically wanted to compile simple-httpbin
to run on JDK 11 - just the current JDK we use - especially since it's not even an artifact we ship but just an internal test scaffolding.
… memory - allowing to handle big files more efficiently WIP: ensuring the resources are closed when we finish using a workbook
…lexibility in how it is performed TODO: update Enso part
…nsuring it works even if the files were held open
…d then open the temp file for writing
# Conflicts: # distribution/lib/Standard/Test/0.0.0-dev/src/Test.enso
Can I please ask someone from engine to approve the |
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.
Don't blame frgaal. Compile against appropriate -target
JDK APIs.
@@ -2717,11 +2717,12 @@ val allStdBits: Parser[String] = | |||
lazy val `simple-httpbin` = project | |||
.in(file("tools") / "simple-httpbin") | |||
.settings( | |||
frgaalJavaCompilerSetting, |
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.
Frgaal by default only exposes only classes that are in API of the JDK. SimpleFileServer
isn't.
no benefit in Frgaal within this sub-project
There is a benefit. It already prevented you from using SimpleFileServer
!
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.
By default we should use -target 11
- to support for example the #8094 effort.
@@ -1330,13 +1330,16 @@ lazy val truffleDslSuppressWarnsSetting = Seq( | |||
) | |||
|
|||
/** A setting to replace javac with Frgaal compiler, allowing to use latest Java features in the code | |||
* and still compile down to JDK 11 | |||
* and still compile down to JDK 17 |
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.
Why do we change the -target
level to 17
?
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.
I don't think there is any sophisticated reason for that. I just thought that it was a good idea to bump that to -target 17
. Furthermore, I vaguely remember that we talked about this as well. But I think we can fall back to 11.
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.
I have only updated the documentation comment to be aligned with what is actually being done.
|
||
import java.util.Random; | ||
|
||
public class RandomHelpers { |
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't use the Faker here?
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.
We could, but I was annoyed with how slow it was:
from Standard.Base import all
from Standard.Test import Faker
polyglot java import org.enso.table_test_helpers.RandomHelpers
main =
n = 10^6
faker = Faker.new 123
r1 = Duration.time_execution <| Vector.new n _-> faker.alpha_numeric 190
IO.println <| " Faker: " + r1.first.to_display_text
rng = RandomHelpers.new 123
r2 = Duration.time_execution <| Vector.new n _-> rng.makeRandomString 190
IO.println <| "RandomHelpers: " + r2.first.to_display_text
Faker: 15.3227068s
RandomHelpers: 01.7083387s
Almost 10x slower. I'll merge as-is but happy to replace back with Faker, as the duplication is not ideal. Maybe we should try to improve the Faker's performance? I think the current way has a lot of overhead.
Pull Request Description
Temporary_File
.simple-httpbin
with ability to serve files for our tests.Infer
option onExcel
format also works with streams, if content-type metadata is available (e.g. from HTTP headers).Temporary_File
facility that can be used to create a temporary file that is deleted once all references to theTemporary_File
instance are GCed.Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
./run ide build
.