Hey team,
Need your help.
I am trying to run the below python code in a data bricks notebook, which is part of parsing an XML file, exploding the element. This works great for all the other elements with no numbers and elements not starting with a zero but anything that starts with a 0 in the second part of the string is where it's failing.
Code:
56:.withColumn('OcrnInfo_Bond-102005', explode_outer(col('OcrnInfo').Bond-102005)) \
57:.withColumn('OcrnInfo_Bond-052009', explode_outer(col('OcrnInfo').Bond-052009)) \
Error:
leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers (, line 57)
.withColumn('OcrnInfo_Bond-052009', explode_outer(col('OcrnInfo').Bond-052009)) \
^
Bond-052009 is a structfield in XML definition of arraytype which in turn has a structype for the attributes it holds. I have tried single/double quotes, all sorts of brackets around the string but just keeps failing with the same error. If I delete this line it fails on the next one which is Bnkrpt-052009 so definitely the second part of the string is failing. I am unable to change these names.
Any advice is greatly appreciated.