jiayuasu commented on code in PR #3138:
URL: https://github.com/apache/sedona/pull/3138#discussion_r3625554966
##########
docs/api/sql/Raster-map-algebra.md:
##########
@@ -72,6 +72,9 @@ execution. We'll demonstrate both approaches to implementing
commonly used map a
This allows controlling the output pixel data type. Users should consider
potential precision impacts when coercing to a smaller type.
+!!!Note
+ Jiffle limits scripts to 200 loop iterations per pixel by default, so a
runaway `while` loop fails fast instead of hanging the executor. If a script
legitimately needs more iterations per pixel, raise (or disable) the limit with
the JVM system property `it.geosolutions.jaiext.jiffle.maxIterations` (a
negative value disables the limit), e.g. `--conf
"spark.executor.extraJavaOptions=-Dit.geosolutions.jaiext.jiffle.maxIterations=10000"`.
Review Comment:
Could we add a packaged-jar check for this setting? It looks like the
relocation may rewrite the upstream property name, so the example here may not
affect the artifact users run.
I reproduced it from this branch with:
```bash
mvn -pl common -DskipTests package
javap -classpath common/target/sedona-common-1.9.1-SNAPSHOT.jar \
-p -constants it.geosolutions.jaiext.jiffle.runtime.AbstractJiffleRuntime
```
The packaged class reports:
```text
MAX_ITERATIONS_KEY = "org.apache.sedona.shaded.jiffle.maxIterations"
```
As a runtime check, I put the packaged jar first on the JShell classpath.
With `it.geosolutions.jaiext.jiffle.maxIterations=10000`, the script `x = 0;
while (x < 201) { x = x + 1; } out = x;` still threw `Exceeded maximum allowed
loop iterations per pixel`; using
`org.apache.sedona.shaded.jiffle.maxIterations=10000` let it finish. Maybe the
exact property string should be excluded from relocation, or the effective
Sedona key should be documented and tested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]