You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@livy.apache.org by "ighack (Jira)" <ji...@apache.org> on 2021/05/20 08:50:00 UTC
[jira] [Created] (LIVY-858) about Chinese display problem?
ighack created LIVY-858:
---------------------------
Summary: about Chinese display problem?
Key: LIVY-858
URL: https://issues.apache.org/jira/browse/LIVY-858
Project: Livy
Issue Type: Bug
Reporter: ighack
statements_url = session_url + '/statements'
data = {
'code': textwrap.dedent("""
import org.apache.spark.sql.\{SaveMode, SparkSession}
import org.apache.spark.sql.types._
import org.apache.spark.\{SparkConf, SparkContext}
val sparkhive = SparkSession.builder().appName("spark read hive").enableHiveSupport().getOrCreate()
val df = sparkhive.sql("select * from hivetest.chinese_par")
df.show()
""")
}
r = requests.post(statements_url, data=json.dumps(data), headers=headers)
pprint.pprint(r.json())
statement_url = host + r.headers['location']
r = requests.get(statement_url, headers=headers)
pprint.pprint(r.json())
I get
'+---+----+----+----+\n'
'| id|name|year|city|\n'
'+---+----+----+----+\n'
'| 4| wk|2019|??|\n'
'| 5| wk|2019|??|\n'
'| 6| wk|2019|??|\n'
'| 7| wk|2019|??|\n'
'| |null|null|??|\n'
'| |null|null|??|\n'
'| |null|null|??|\n'
'| 8| wk|2020|??|\n'
'| 9| wk|2020|??|\n'
'| 10| wk|2020|??|\n'
'| 11| wk|2020|??|\n'
'| 1| wk|2018|??|\n'
'| 2| wk|2018|??|\n'
'| 3| wk|2018|??|\n'
'| 3| wk|2018|??|\n'
'+---+----+----+----+\n'
city is chinese, but display as "?"
--
This message was sent by Atlassian Jira
(v8.3.4#803005)