# -*- coding: utf-8 -*- """ Created on Thu Oct 24 22:42:50 2019 @author: prabha """ import pyspark from pyspark.sql import SparkSession from pyspark.sql.functions import col from pyspark.sql.functions import to_timestamp, current_timestamp from pyspark.sql.types import StructType, StructField, StringType, IntegerType, LongType spark = SparkSession.builder.appName('SparkByExamples.com').getOrCreate() schema = StructType([ StructField("seq", StringType(), True)]) dates = ['1'] df = spark.createDataFrame(list('1'), schema=schema) df.show()