[enhancement] loadFlatMap

Issue #542 wontfix
김승갑 created an issue

yaml object → flatMap

// yaml
a:
  b: 1
  c: 2
  d: 
    e: 5

// map
"a.b" to 1
"a.c" to 2
"a.d.e" to 5

Comments (9)

  1. Alexander Maslov

    @김승갑 I can imaging why you want this kind of map, but I do not think it belongs to this library as a core function.
    You can do exactly the same outside of snakeyalm. Apply your flatMap to Map<String, Object> loaded using snakeyaml.

    Just like you do in pull request #18.

  2. 김승갑 reporter

    @Alexander Maslov

    right. but, yaml → flatMap is useful in configuration (spring, apache, ..)

    if you don’t need to this pr.

    close this~

  3. 김승갑 reporter
    spark:
      sql:
        crossJoin.enabled: true
        hive.convertMetastoreOrc: false
        sources.partitionOverwriteMode: dynamic
        broadcastTimeout: 36000
        autoBroadcastJoinThreshold: -1
        legacy:
          parquet:
            int96RebaseModeInRead: CORRECTED
            int96RebaseModeInWrite: CORRECTED
            datetimeRebaseModeInRead: CORRECTED
            datetimeRebaseModeInWrite: CORRECTED
          timeParserPolicy: LEGACY
          storeAssignmentPolicy: LEGACY
    
    hive:
      exec:
        dynamic.partition: true
        dynamic.partition.mode: nonstrict
      metastore:
        client:
          factory:
            class: com.amazonaws.glue.catalog.metastore.AWSGlueDataCatalogHiveClientFactory
    

  4. Alexander Maslov

    This seems to be an interesting use case, but not for the general yaml parsing library.

    You can post/pre porcess maps you are dumping and loading to achieve what you need.

  5. Log in to comment