Beispiel #1
0
        static PythonSerDe()
        {
            // Custom picklers used in PySpark implementation.
            // Refer to spark/python/pyspark/sql/types.py.
            Unpickler.registerConstructor(
                "pyspark.sql.types", "_parse_datatype_json_string", new StringConstructor());

            s_rowConstructor = new RowConstructor();
            Unpickler.registerConstructor(
                "pyspark.sql.types", "_create_row_inbound_converter", s_rowConstructor);
        }
Beispiel #2
0
        protected virtual T CreateRow(IRelationalRow sourceRow)
        {
            if (RowConstructor == null)
            {
                throw new NotSupportedException("No matching constructor found.");
            }

            return((T)RowConstructor.Invoke(new object[] {
                this, sourceRow
            }));
        }
Beispiel #3
0
        static PythonSerDe()
        {
            // Custom picklers used in PySpark implementation.
            // Refer to spark/python/pyspark/sql/types.py.
            Unpickler.registerConstructor(
                "pyspark.sql.types", "_parse_datatype_json_string", new StringConstructor());

            s_rowConstructor = new RowConstructor();
            Unpickler.registerConstructor(
                "pyspark.sql.types", "_create_row_inbound_converter", s_rowConstructor);

            // Register custom picklers.
            Pickler.registerCustomPickler(typeof(Row), new RowPickler());
            Pickler.registerCustomPickler(typeof(GenericRow), new GenericRowPickler());
            Pickler.registerCustomPickler(typeof(Date), new DatePickler());
            Pickler.registerCustomPickler(typeof(Timestamp), new TimestampPickler());
        }