Github user marmbrus commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1346#discussion_r15481293
  
    --- Diff: python/pyspark/sql.py ---
    @@ -20,8 +20,413 @@
     
     from py4j.protocol import Py4JError
     
    -__all__ = ["SQLContext", "HiveContext", "LocalHiveContext", 
"TestHiveContext", "SchemaRDD", "Row"]
    +__all__ = [
    +    "StringType", "BinaryType", "BooleanType", "DecimalType", "DoubleType",
    +    "FloatType", "ByteType", "IntegerType", "LongType", "ShortType",
    +    "ArrayType", "MapType", "StructField", "StructType",
    +    "SQLContext", "HiveContext", "LocalHiveContext", "TestHiveContext", 
"SchemaRDD", "Row"]
     
    +class PrimitiveTypeSingleton(type):
    +    _instances = {}
    +    def __call__(cls):
    +        if cls not in cls._instances:
    +            cls._instances[cls] = super(PrimitiveTypeSingleton, 
cls).__call__()
    +        return cls._instances[cls]
    +
    +class StringType(object):
    +    """Spark SQL StringType
    +
    +    The data type representing string values.
    +
    +    """
    +    __metaclass__ = PrimitiveTypeSingleton
    +
    +    def _get_scala_type_string(self):
    +        return "StringType"
    +
    +class BinaryType(object):
    +    """Spark SQL BinaryType
    +
    +    The data type representing bytes values and bytearray values.
    +
    +    """
    +    __metaclass__ = PrimitiveTypeSingleton
    +
    +    def _get_scala_type_string(self):
    +        return "BinaryType"
    +
    +class BooleanType(object):
    +    """Spark SQL BooleanType
    +
    +    The data type representing bool values.
    +
    +    """
    +    __metaclass__ = PrimitiveTypeSingleton
    +
    +    def _get_scala_type_string(self):
    +        return "BooleanType"
    +
    +class TimestampType(object):
    +    """Spark SQL TimestampType"""
    --- End diff --
    
    We should also list the python types that are expected when its not obvious.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to