sqlcontext.sqlfield id中的编码错误:IntegerType无法接受类型<type'unicode'>中的对象u'1'

时间:2019-08-13 15:24:46

标签: python apache-spark rdd

从蜂巢表中提取数据并显示如下错误。有人可以帮忙吗

UnicodeEncodeError:'ascii'编解码器无法在位置3205处编码字符u'\ xe9':序数不在范围内(128)

#!/usr/bin/env python
# coding: utf-8
import os
import sys
from pyspark import SparkContext
from pyspark.sql import SparkSession
from pyspark.sql.types import *
from pyspark.sql import HiveContext
from pyspark.sql import SQLContext

spark=SparkSession.builder.getOrCreate()
#sc=SparkContext()
# Creating Context        
sc = SparkContext.getOrCreate()
sqlcontext=SQLContext(sc)
# In[82]:
# filename=sys.argv[1]
df1 = spark.sql("select bdate,rawdata,rawdata1 from fraud_staging_1.stg_frc_fircohitdetails_1")
df1.show()

0 个答案:

没有答案