Github user felixcheung commented on a diff in the pull request:
https://github.com/apache/spark/pull/15516#discussion_r84168871
--- Diff: R/pkg/R/utils.R ---
@@ -385,6 +385,41 @@ getStorageLevel <- function(newLevel = c("DISK_ONLY",
"OFF_HEAP" = callJStatic(storageLevelClass,
"OFF_HEAP"))
}
+storageLevelToString <- function(levelObj) {
+ useDisk <- callJMethod(levelObj, "useDisk")
+ useMemory <- callJMethod(levelObj, "useMemory")
+ useOffHeap <- callJMethod(levelObj, "useOffHeap")
+ deserialized <- callJMethod(levelObj, "deserialized")
+ replication <- callJMethod(levelObj, "replication")
+ if (!useDisk && !useMemory && !useOffHeap && !deserialized &&
replication == 1) {
--- End diff --
hardcoding the variations in R could be hard to maintain or easily get out
of sync. is there anyway to do this?
Python seems to be able to get the enum name as a string
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]