Re: [PR] fix(common): honor SPARK_LOCAL_DIRS in Hudi spillable map path resolution [hudi]
nsivabalan merged PR #19904: URL: https://github.com/apache/hudi/pull/19904 -- 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]
Re: [PR] fix(common): honor SPARK_LOCAL_DIRS in Hudi spillable map path resolution [hudi]
hudi-bot commented on PR #19904: URL: https://github.com/apache/hudi/pull/19904#issuecomment-5835196098 ## CI report: * 4c26f2d237c0ac621d190c56098935e686185c7d Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17278) Bot commands @hudi-bot supports the following commands: - `@hudi-bot run azure` re-run the last Azure build -- 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]
Re: [PR] fix(common): honor SPARK_LOCAL_DIRS in Hudi spillable map path resolution [hudi]
hudi-bot commented on PR #19904: URL: https://github.com/apache/hudi/pull/19904#issuecomment-5832952531 ## CI report: * Unknown: [CANCELED](TBD) * 4c26f2d237c0ac621d190c56098935e686185c7d Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17278) Bot commands @hudi-bot supports the following commands: - `@hudi-bot run azure` re-run the last Azure build -- 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]
Re: [PR] fix(common): honor SPARK_LOCAL_DIRS in Hudi spillable map path resolution [hudi]
hudi-bot commented on PR #19904: URL: https://github.com/apache/hudi/pull/19904#issuecomment-5832868165 ## CI report: * Unknown: [CANCELED](TBD) * 4c26f2d237c0ac621d190c56098935e686185c7d UNKNOWN Bot commands @hudi-bot supports the following commands: - `@hudi-bot run azure` re-run the last Azure build -- 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]
Re: [PR] fix(common): honor SPARK_LOCAL_DIRS in Hudi spillable map path resolution [hudi]
vamsikarnika commented on PR #19904: URL: https://github.com/apache/hudi/pull/19904#issuecomment-5828404193 @hudi-bot run azure -- 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]
Re: [PR] fix(common): honor SPARK_LOCAL_DIRS in Hudi spillable map path resolution [hudi]
wombatu-kun commented on code in PR #19904:
URL: https://github.com/apache/hudi/pull/19904#discussion_r4100986850
##
hudi-hadoop-common/src/test/java/org/apache/hudi/common/util/TestFileIOUtils.java:
##
@@ -80,24 +107,60 @@ public void testReadAsUTFStringLines() {
@Test
public void testGetConfiguredLocalDirs() {
-Map env = System.getenv();
-Class clazz = env.getClass();
-Map envMaps = null;
-try {
- Field field = clazz.getDeclaredField("m");
- field.setAccessible(true);
- envMaps = (Map) field.get(env);
- envMaps.put("CONTAINER_ID", "x");
-} catch (NoSuchFieldException | IllegalAccessException e) {
- throw new IllegalArgumentException(e);
-}
+Map envMaps = mutableEnv();
assertEquals(String.join("", FileIOUtils.getConfiguredLocalDirs()),
System.getProperty("java.io.tmpdir"));
+envMaps.put("CONTAINER_ID", "x");
Review Comment:
Moving `CONTAINER_ID` below the first assertion drops the only check that
`CONTAINER_ID` without `LOCAL_DIRS` is not treated as YARN, so deleting the
`LOCAL_DIRS` half of `isRunningInYarnContainer` would no longer fail any test.
Putting this `put` back above the first `assertEquals` restores that check, and
the new `@AfterEach` keeps it from leaking into later tests.
--
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]
Re: [PR] fix(common): honor SPARK_LOCAL_DIRS in Hudi spillable map path resolution [hudi]
vamsikarnika commented on PR #19904: URL: https://github.com/apache/hudi/pull/19904#issuecomment-5815552146 Good catch — `testGetDefaultSpillableMapBasePath` had no guard against an inherited `SPARK_LOCAL_DIRS`. Fixed in 4c26f2d237c0 by moving the save/clear/restore of `CONTAINER_ID`/`LOCAL_DIRS`/`SPARK_LOCAL_DIRS` into class-wide `@BeforeEach`/`@AfterEach` on `TestFileIOUtils`, so every test (including this one) gets it instead of relying on ad-hoc per-test guards. -- 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]
Re: [PR] fix(common): honor SPARK_LOCAL_DIRS in Hudi spillable map path resolution [hudi]
vamsikarnika commented on code in PR #19904:
URL: https://github.com/apache/hudi/pull/19904#discussion_r4094457344
##
hudi-hadoop-common/src/test/java/org/apache/hudi/common/util/TestFileIOUtils.java:
##
@@ -80,24 +80,73 @@ public void testReadAsUTFStringLines() {
@Test
public void testGetConfiguredLocalDirs() {
-Map env = System.getenv();
-Class clazz = env.getClass();
-Map envMaps = null;
-try {
- Field field = clazz.getDeclaredField("m");
- field.setAccessible(true);
- envMaps = (Map) field.get(env);
- envMaps.put("CONTAINER_ID", "x");
-} catch (NoSuchFieldException | IllegalAccessException e) {
- throw new IllegalArgumentException(e);
-}
+Map envMaps = mutableEnv();
+envMaps.put("CONTAINER_ID", "x");
+// getConfiguredLocalDirs now also consults SPARK_LOCAL_DIRS; drop any
value inherited
+// from the developer's shell so this assertion stays about the tmpdir
fallback.
+envMaps.remove("SPARK_LOCAL_DIRS");
Review Comment:
Good catch — `testGetDefaultSpillableMapBasePath` had no guard against an
inherited `SPARK_LOCAL_DIRS`. Fixed in 4c26f2d by moving the save/clear/restore
of `CONTAINER_ID`/`LOCAL_DIRS`/`SPARK_LOCAL_DIRS` into class-wide
`@BeforeEach`/`@AfterEach` on `TestFileIOUtils`, so every test (including this
one) gets it instead of relying on ad-hoc per-test guards.
##
hudi-io/src/main/java/org/apache/hudi/io/util/FileIOUtils.java:
##
@@ -269,6 +269,11 @@ public static String[] getConfiguredLocalDirs() {
// created the directories already, and that they are secured so that
only the
// user has access to them.
return getYarnLocalDirs().split(",");
+} else if (System.getenv("SPARK_LOCAL_DIRS") != null) {
+ // Kubernetes provides no scheduler-side local-dir contract like YARN's,
so Spark itself
+ // publishes the mounted scratch paths here. Without this we fall
through to
+ // java.io.tmpdir, i.e. /tmp inside the container rather than the
mounted disk.
+ return System.getenv("SPARK_LOCAL_DIRS").split(",");
Review Comment:
Confirmed and fixed in 4c26f2d — dropped the
`props.setProperty(SPILLABLE_MAP_BASE_PATH.key(), ...)` pin in
`getReaderProperties()`. Traced the two consumers (`FileGroupRecordBuffer`,
`LsmFileGroupRecordIterator`) and both already resolve the default lazily via
`FileIOUtils.getDefaultSpillableMapBasePath()` inside the executor-side closure
when the key is absent from props, so this is a pure removal — no fallback
logic needed. Verified the plain write path (`BaseSparkCommitActionExecutor`)
and compaction (`HoodieCompactor`) don't have this bug since they resolve
`config.getSpillableMapBasePath()` inside the per-partition lambda already,
which is why this only showed up in clustering.
##
hudi-io/src/main/java/org/apache/hudi/io/util/FileIOUtils.java:
##
@@ -269,6 +269,11 @@ public static String[] getConfiguredLocalDirs() {
// created the directories already, and that they are secured so that
only the
// user has access to them.
return getYarnLocalDirs().split(",");
+} else if (System.getenv("SPARK_LOCAL_DIRS") != null) {
Review Comment:
Agreed this is real, but it's a separate bug in a different config's default
(`FileSystemViewStorageConfig.SPILLABLE_DIR` hardcoded to `/tmp/`, inferred
into `HoodieMetadataConfig.SPILLABLE_MAP_DIR_PROP`) rather than anything this
PR's `FileIOUtils` change touches. Tracking it as a follow-up rather than
folding it into this PR, per your note that it's not a blocker here.
--
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]
Re: [PR] fix(common): honor SPARK_LOCAL_DIRS in Hudi spillable map path resolution [hudi]
wombatu-kun commented on code in PR #19904:
URL: https://github.com/apache/hudi/pull/19904#discussion_r4022628302
##
hudi-hadoop-common/src/test/java/org/apache/hudi/common/util/TestFileIOUtils.java:
##
@@ -80,24 +80,73 @@ public void testReadAsUTFStringLines() {
@Test
public void testGetConfiguredLocalDirs() {
-Map env = System.getenv();
-Class clazz = env.getClass();
-Map envMaps = null;
-try {
- Field field = clazz.getDeclaredField("m");
- field.setAccessible(true);
- envMaps = (Map) field.get(env);
- envMaps.put("CONTAINER_ID", "x");
-} catch (NoSuchFieldException | IllegalAccessException e) {
- throw new IllegalArgumentException(e);
-}
+Map envMaps = mutableEnv();
+envMaps.put("CONTAINER_ID", "x");
+// getConfiguredLocalDirs now also consults SPARK_LOCAL_DIRS; drop any
value inherited
+// from the developer's shell so this assertion stays about the tmpdir
fallback.
+envMaps.remove("SPARK_LOCAL_DIRS");
Review Comment:
`testGetDefaultSpillableMapBasePath` has the same dependency on
`SPARK_LOCAL_DIRS` being unset but no equivalent guard, and it sorts ahead of
this method, so both of its assertions break on a machine whose shell exports
the variable. Worth clearing the three vars in a `@BeforeEach` rather than only
here.
##
hudi-io/src/main/java/org/apache/hudi/io/util/FileIOUtils.java:
##
@@ -269,6 +269,11 @@ public static String[] getConfiguredLocalDirs() {
// created the directories already, and that they are secured so that
only the
// user has access to them.
return getYarnLocalDirs().split(",");
+} else if (System.getenv("SPARK_LOCAL_DIRS") != null) {
Review Comment:
`ConfigUtils.buildFileGroupReaderProperties` pins
`hoodie.memory.spillable.map.path` to
`HoodieMetadataConfig.getSplliableMapDir()`, which infers from
`FileSystemViewStorageConfig.SPILLABLE_DIR` and its hardcoded `/tmp/` default,
so every metadata-table read still spills to the container disk after this
change. Giving `SPILLABLE_DIR` the same `getDefaultSpillableMapBasePath()`
resolution would cover it - follow-up, not a blocker.
##
hudi-io/src/main/java/org/apache/hudi/io/util/FileIOUtils.java:
##
@@ -269,6 +269,11 @@ public static String[] getConfiguredLocalDirs() {
// created the directories already, and that they are secured so that
only the
// user has access to them.
return getYarnLocalDirs().split(",");
+} else if (System.getenv("SPARK_LOCAL_DIRS") != null) {
+ // Kubernetes provides no scheduler-side local-dir contract like YARN's,
so Spark itself
+ // publishes the mounted scratch paths here. Without this we fall
through to
+ // java.io.tmpdir, i.e. /tmp inside the container rather than the
mounted disk.
+ return System.getenv("SPARK_LOCAL_DIRS").split(",");
Review Comment:
`ClusteringExecutionStrategy.getReaderProperties` pins this value into props
that `MultipleSparkJobExecutionStrategy.readRecordsForGroupAsRow` builds on the
driver and ships into the task closure, so executors spill to the driver's
`SPARK_LOCAL_DIRS` rather than their own. Is clustering in scope here -
dropping that `setProperty` would let each executor resolve locally, since an
explicitly configured value is already in the copied props.
--
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]
Re: [PR] fix(common): honor SPARK_LOCAL_DIRS in Hudi spillable map path resolution [hudi]
hudi-bot commented on PR #19904: URL: https://github.com/apache/hudi/pull/19904#issuecomment-5639022738 ## CI report: * 6932ebd06591a391dd35c647344eb47e994a7a42 Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17017) Bot commands @hudi-bot supports the following commands: - `@hudi-bot run azure` re-run the last Azure build -- 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]
Re: [PR] fix(common): honor SPARK_LOCAL_DIRS in Hudi spillable map path resolution [hudi]
hudi-bot commented on PR #19904: URL: https://github.com/apache/hudi/pull/19904#issuecomment-5637442370 ## CI report: * 7b938691021f566e87d7c8043b16a3a72d79252a Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17003) * 6932ebd06591a391dd35c647344eb47e994a7a42 Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17017) Bot commands @hudi-bot supports the following commands: - `@hudi-bot run azure` re-run the last Azure build -- 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]
Re: [PR] fix(common): honor SPARK_LOCAL_DIRS in Hudi spillable map path resolution [hudi]
hudi-bot commented on PR #19904: URL: https://github.com/apache/hudi/pull/19904#issuecomment-5637372083 ## CI report: * 7b938691021f566e87d7c8043b16a3a72d79252a Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17003) * 6932ebd06591a391dd35c647344eb47e994a7a42 UNKNOWN Bot commands @hudi-bot supports the following commands: - `@hudi-bot run azure` re-run the last Azure build -- 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]
Re: [PR] fix(common): honor SPARK_LOCAL_DIRS in Hudi spillable map path resolution [hudi]
vamsikarnika commented on code in PR #19904:
URL: https://github.com/apache/hudi/pull/19904#discussion_r3991110400
##
hudi-hadoop-common/src/test/java/org/apache/hudi/common/util/TestFileIOUtils.java:
##
@@ -98,6 +101,61 @@ public void testGetConfiguredLocalDirs() {
envMaps.get("LOCAL_DIRS"));
}
+ @Test
+ public void testGetConfiguredLocalDirsPrefersSparkLocalDirs() {
+Map envMaps = mutableEnv();
+String originalContainerId = envMaps.get("CONTAINER_ID");
+String originalLocalDirs = envMaps.get("LOCAL_DIRS");
+String originalSparkLocalDirs = envMaps.get("SPARK_LOCAL_DIRS");
+try {
+ // Not under YARN: SPARK_LOCAL_DIRS is used in preference to
java.io.tmpdir.
+ envMaps.remove("CONTAINER_ID");
+ envMaps.remove("LOCAL_DIRS");
+ envMaps.put("SPARK_LOCAL_DIRS", "/spark-dir-1");
+ assertEquals("/spark-dir-1", String.join("",
FileIOUtils.getConfiguredLocalDirs()));
+
+ // Comma separated values are split, as they are for YARN.
+ envMaps.put("SPARK_LOCAL_DIRS", "/spark-dir-1,/spark-dir-2");
+ assertEquals(Arrays.asList("/spark-dir-1", "/spark-dir-2"),
+ Arrays.asList(FileIOUtils.getConfiguredLocalDirs()));
+
+ // YARN keeps precedence when both are present.
+ envMaps.put("CONTAINER_ID", "container_xxx");
+ envMaps.put("LOCAL_DIRS", "/yarn-dir");
+ assertEquals("/yarn-dir", String.join("",
FileIOUtils.getConfiguredLocalDirs()));
+
+ // Neither set: unchanged fallback to java.io.tmpdir.
+ envMaps.remove("CONTAINER_ID");
Review Comment:
Good catch — refactored `testGetConfiguredLocalDirs` to reuse `mutableEnv()`
instead of keeping a second copy of the reflection lookup.
--
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]
Re: [PR] fix(common): honor SPARK_LOCAL_DIRS in Hudi spillable map path resolution [hudi]
hudi-bot commented on PR #19904: URL: https://github.com/apache/hudi/pull/19904#issuecomment-5631800876 ## CI report: * 7b938691021f566e87d7c8043b16a3a72d79252a Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17003) Bot commands @hudi-bot supports the following commands: - `@hudi-bot run azure` re-run the last Azure build -- 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]
Re: [PR] fix(common): honor SPARK_LOCAL_DIRS in Hudi spillable map path resolution [hudi]
codecov-commenter commented on PR #19904: URL: https://github.com/apache/hudi/pull/19904#issuecomment-5630867926 ## [Codecov](https://app.codecov.io/gh/apache/hudi/pull/19904?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report :x: Patch coverage is `0%` with `2 lines` in your changes missing coverage. Please review. :white_check_mark: Project coverage is 79.94%. Comparing base ([`a46909b`](https://app.codecov.io/gh/apache/hudi/commit/a46909b09bbb044acda01a41dfc90ea844fe05b3?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`7b93869`](https://app.codecov.io/gh/apache/hudi/commit/7b938691021f566e87d7c8043b16a3a72d79252a?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)). :warning: Report is 1 commits behind head on master. | [Files with missing lines](https://app.codecov.io/gh/apache/hudi/pull/19904?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines | |---|---|---| | [...main/java/org/apache/hudi/io/util/FileIOUtils.java](https://app.codecov.io/gh/apache/hudi/pull/19904?src=pr&el=tree&filepath=hudi-io%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fhudi%2Fio%2Futil%2FFileIOUtils.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aHVkaS1pby9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaHVkaS9pby91dGlsL0ZpbGVJT1V0aWxzLmphdmE=) | 0.00% | [1 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/hudi/pull/19904?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #19904 +/- ## - Coverage 80.20% 79.94% -0.27% + Complexity3467034566 -104 Files 2546 2546 Lines142455 142457 +2 Branches 1733217333 +1 - Hits 114263 113885 -378 - Misses2029020649 +359 - Partials 7902 7923 +21 ``` | [Components](https://app.codecov.io/gh/apache/hudi/pull/19904/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | |---|---|---| | [hudi-common](https://app.codecov.io/gh/apache/hudi/pull/19904/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `83.78% <ø> (-0.07%)` | :arrow_down: | | [hudi-client](https://app.codecov.io/gh/apache/hudi/pull/19904/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `83.22% <ø> (-0.06%)` | :arrow_down: | | [hudi-flink](https://app.codecov.io/gh/apache/hudi/pull/19904/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `83.86% <ø> (-1.72%)` | :arrow_down: | | [hudi-spark-datasource](https://app.codecov.io/gh/apache/hudi/pull/19904/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.28% <ø> (ø)` | | | [hudi-utilities](https://app.codecov.io/gh/apache/hudi/pull/19904/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `78.15% <ø> (ø)` | | | [hudi-cli](https://app.codecov.io/gh/apache/hudi/pull/19904/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `69.99% <ø> (ø)` | | | [hudi-hadoop](https://app.codecov.io/gh/apache/hudi/pull/19904/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `70.82% <ø> (ø)` | | | [hudi-sync](https://app.codecov.io/gh/apache/hudi/pull/19904/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `76.02% <ø> (ø)` | | | [hudi-io](https://app.codecov.io/gh/apache/hudi/pull/19904/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `81.44% <0.00%> (-0.08%)` | :arrow_down: | |
Re: [PR] fix(common): honor SPARK_LOCAL_DIRS in Hudi spillable map path resolution [hudi]
hudi-bot commented on PR #19904: URL: https://github.com/apache/hudi/pull/19904#issuecomment-5630830123 ## CI report: * 7b938691021f566e87d7c8043b16a3a72d79252a Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17003) Bot commands @hudi-bot supports the following commands: - `@hudi-bot run azure` re-run the last Azure build -- 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]
Re: [PR] fix(common): honor SPARK_LOCAL_DIRS in Hudi spillable map path resolution [hudi]
hudi-bot commented on PR #19904: URL: https://github.com/apache/hudi/pull/19904#issuecomment-5630630279 ## CI report: * 7b938691021f566e87d7c8043b16a3a72d79252a UNKNOWN Bot commands @hudi-bot supports the following commands: - `@hudi-bot run azure` re-run the last Azure build -- 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]
Re: [PR] fix(common): honor SPARK_LOCAL_DIRS in Hudi spillable map path resolution [hudi]
hudi-agent commented on code in PR #19904:
URL: https://github.com/apache/hudi/pull/19904#discussion_r3986597934
##
hudi-hadoop-common/src/test/java/org/apache/hudi/common/util/TestFileIOUtils.java:
##
@@ -98,6 +101,61 @@ public void testGetConfiguredLocalDirs() {
envMaps.get("LOCAL_DIRS"));
}
+ @Test
+ public void testGetConfiguredLocalDirsPrefersSparkLocalDirs() {
+Map envMaps = mutableEnv();
+String originalContainerId = envMaps.get("CONTAINER_ID");
+String originalLocalDirs = envMaps.get("LOCAL_DIRS");
+String originalSparkLocalDirs = envMaps.get("SPARK_LOCAL_DIRS");
+try {
+ // Not under YARN: SPARK_LOCAL_DIRS is used in preference to
java.io.tmpdir.
+ envMaps.remove("CONTAINER_ID");
+ envMaps.remove("LOCAL_DIRS");
+ envMaps.put("SPARK_LOCAL_DIRS", "/spark-dir-1");
+ assertEquals("/spark-dir-1", String.join("",
FileIOUtils.getConfiguredLocalDirs()));
+
+ // Comma separated values are split, as they are for YARN.
+ envMaps.put("SPARK_LOCAL_DIRS", "/spark-dir-1,/spark-dir-2");
+ assertEquals(Arrays.asList("/spark-dir-1", "/spark-dir-2"),
+ Arrays.asList(FileIOUtils.getConfiguredLocalDirs()));
+
+ // YARN keeps precedence when both are present.
+ envMaps.put("CONTAINER_ID", "container_xxx");
+ envMaps.put("LOCAL_DIRS", "/yarn-dir");
+ assertEquals("/yarn-dir", String.join("",
FileIOUtils.getConfiguredLocalDirs()));
+
+ // Neither set: unchanged fallback to java.io.tmpdir.
+ envMaps.remove("CONTAINER_ID");
Review Comment:
🤖 nit: this reflection-based env access duplicates the inline logic already
used at the top of `testGetConfiguredLocalDirs` (field "m" lookup). Worth
factoring both into a single shared private helper to avoid two copies of the
same reflection hack.
⚠️ AI-generated; verify before applying. React 👍/👎 to flag
quality.
--
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]
