Here is the code to create a DataFrame with the schema you provided:
from pyspark.sql.types import *
from pyspark.sql import SparkSession
spark = SparkSession.builder.getOrCreate()
schema = StructType([
StructField("visitorId", LongType(), True),
StructField("visitNumber", LongType(), True),
StructField("visitId", LongType(), True),
StructField("visitStartTime", LongType(), True),
StructField("date", StringType(), True),
StructField("totals", StructType([
StructField("visits", LongType(), True),
StructField("hits", LongType(), True),
StructField("pageviews", LongType(), True),
StructField("timeOnSite", LongType(), True),
StructField("bounces", LongType(), True),
StructField("transactions", LongType(), True),
StructField("transactionRevenue", LongType(), True),
StructField("newVisits", LongType(), True),
StructField("screenviews", LongType(), True),
StructField("uniqueScreenviews", LongType(), True),
StructField("timeOnScreen", LongType(), True),
StructField("totalTransactionRevenue", LongType(), True),
StructField("sessionQualityDim", LongType(), True)
]), True),
StructField("trafficSource", StructType([
StructField("referralPath", StringType(), True),
StructField("campaign", StringType(), True),
StructField("source", StringType(), True),
StructField("medium", StringType(), True),
StructField("keyword", StringType(), True),
StructField("adContent", StringType(), True),
StructField("adwordsClickInfo", StructType([
StructField("campaignId", LongType(), True),
StructField("adGroupId", LongType(), True),
StructField("creativeId", LongType(), True),
StructField("criteriaId", LongType(), True),
StructField("page", LongType(), True),
StructField("slot", StringType(), True),
StructField("criteriaParameters", StringType(), True),
StructField("gclId", StringType(), True),
StructField("customerId", LongType(), True),
StructField("adNetworkType", StringType(), True),
StructField("targetingCriteria", StructType([
StructField("boomUserlistId", LongType(), True