0

conf file :

hdfs {
 asd = 1
 asd.bla = 2 
}

when I m trying to load the config file

 config.getConfig("hdfs")

the keys are merged, and are not separeted

Config(SimpleConfigObject({"asd":{"bla":2}}))

Workaround to use conf file like this :

hdfs {
 asd = 1
 asd-bla = 2 
}

Config(SimpleConfigObject({"asd":1,"asd-bla":2}))
Gaël J
  • 11,274
  • 4
  • 17
  • 32

1 Answers1

3

It works as intended - see specification of HOCON.

hdfs {
 asd = 1
 asd.bla = 2 
}

is the same as

hdfs {
 asd = 1
 asd = {
  bla = 2 
 }
}

If you want a JSON behavior... use JSON syntax, including "":

hdfs {
 asd = 1
 "asd.bla" = 2 
}

Without quotes it will treat dots as nested keys

Mateusz Kubuszok
  • 24,995
  • 4
  • 42
  • 64