public override void CreateThrift(Field se, Thrift.SchemaElement parent, IList <Thrift.SchemaElement> container)
        {
            base.CreateThrift(se, parent, container);

            //modify this element slightly
            Thrift.SchemaElement tse = container.Last();

            if (se is DecimalDataField dse)
            {
                if (dse.ForceByteArrayEncoding)
                {
                    tse.Type = Thrift.Type.FIXED_LEN_BYTE_ARRAY;
                }
                else
                {
                    if (dse.Precision <= 9)
                    {
                        tse.Type = Thrift.Type.INT32;
                    }
                    else if (dse.Precision <= 18)
                    {
                        tse.Type = Thrift.Type.INT64;
                    }
                    else
                    {
                        tse.Type = Thrift.Type.FIXED_LEN_BYTE_ARRAY;
                    }
                }

                tse.Precision   = dse.Precision;
                tse.Scale       = dse.Scale;
                tse.Type_length = BigDecimal.GetBufferSize(dse.Precision);
            }
            else
            {
                //set defaults
                tse.Precision   = 38;
                tse.Scale       = 18;
                tse.Type_length = 16;
            }
        }
        /// <summary>
        /// Constructs class instance
        /// </summary>
        /// <param name="name">The name of the column</param>
        /// <param name="precision">Cusom precision</param>
        /// <param name="scale">Custom scale</param>
        /// <param name="forceByteArrayEncoding">Whether to force decimal type encoding as fixed bytes. Hive and Impala only understands decimals when forced to true.</param>
        public DecimalSchemaElement(string name, int precision, int scale, bool forceByteArrayEncoding = false) : base(name)
        {
            if (precision < 1)
            {
                throw new ArgumentException("precision cannot be less than 1", nameof(precision));
            }
            if (scale < 1)
            {
                throw new ArgumentException("scale cannot be less than 1", nameof(scale));
            }

            Thrift.Type tt;

            if (forceByteArrayEncoding)
            {
                tt = Parquet.Thrift.Type.FIXED_LEN_BYTE_ARRAY;
            }
            else
            {
                if (precision <= 9)
                {
                    tt = Parquet.Thrift.Type.INT32;
                }
                else if (precision <= 18)
                {
                    tt = Parquet.Thrift.Type.INT64;
                }
                else
                {
                    tt = Parquet.Thrift.Type.FIXED_LEN_BYTE_ARRAY;
                }
            }

            Thrift.Type           = tt;
            Thrift.Converted_type = Parquet.Thrift.ConvertedType.DECIMAL;
            Thrift.Precision      = precision;
            Thrift.Scale          = scale;
            Thrift.Type_length    = BigDecimal.GetBufferSize(precision);
            ElementType           = ColumnType = typeof(decimal);
        }