Advertisement
JBOliveira

Struct - before

Dec 22nd, 2021
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.37 KB | None | 0 0
  1. SCHEMA = StructType([
  2.     StructField('Foo', StringType()),
  3.     StructField('TimeA', StructType([
  4.         StructField('__encode__', StringType()),
  5.         StructField('value', DoubleType()),
  6.     ]), metadata={'encoding': 'timestamp'}),
  7.     StructField('ListOfItems', ArrayType(StructType([
  8.         StructField('Bar', StringType()),
  9.         StructField('Item', StructType([
  10.             StructField('TimeB', StructType([
  11.                 StructField('__encode__', StringType()),
  12.                 StructField('value', DoubleType()),
  13.             ]), metadata={'encoding': 'timestamp'}),
  14.             StructField('Baz', StringType()),
  15.         ])),
  16.     ]))),
  17.     StructField('ComplexStruct', StructType([
  18.         StructField('ComplexLevel1', StructType([
  19.             StructField('TimeC', StructType([
  20.                 StructField('__encode__', StringType()),
  21.                 StructField('value', DoubleType()),
  22.             ]), metadata={'encoding': 'timestamp'}),
  23.             StructField('Field', StringType()),
  24.             StructField('ComplexLevel2', StructType([
  25.                 StructField('TimeD', StructType([
  26.                     StructField('__encode__', StringType()),
  27.                     StructField('value', DoubleType()),
  28.                 ]), metadata={'encoding': 'timestamp'}),
  29.             ])),
  30.             StructField('Foo', IntegerType()),
  31.         ])),
  32.     ])),
  33. ])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement