spark1.2.0版本SparkSQL使用parquet类型注意事项
2014-12-23 17:37
399 查看
在Spark1.2.0版本中是用parquet存储类型时注意事项:
sql语句:
在spark-sql中执行结果:
在beeline中执行结果:
报错:
在hive中执行结果:
可以通过设置
来解决spark-sql以及beeline中的问题,在spark1.2.0版本中该参数默认值为false;
说明:Some other Parquet-producing systems, in particular Impala and older versions of Spark SQL, do not differentiate between binary data and strings when writing out the Parquet schema. This flag tells Spark SQL to interpret binary data as a string to provide compatibility with these systems.
sql语句:
select * from order_created_dynamic_partition_parquet;
在spark-sql中执行结果:
2014-05 [B@4621484a [B@3311163e 2014-05 [B@70ab973a [B@11559aa0 2014-05 [B@b1a8744 [B@7aa6870d 2014-05 [B@765e2d02 [B@20dd1b04 2014-05 [B@1418b477 [B@61effaef
在beeline中执行结果:
报错:
Error: java.lang.ClassCastException: [B cannot be cast to java.lang.String (state=,code=0)
在hive中执行结果:
ordernumber event_time event_month 10703007267488 2014-05-01 06:01:12.334+01 2014-05 10101043505096 2014-05-01 07:28:12.342+01 2014-05 10103043509747 2014-05-01 07:50:12.33+01 2014-05 10103043501575 2014-05-01 09:27:12.33+01 2014-05 10104043514061 2014-05-01 09:03:12.324+01 2014-05
可以通过设置
set spark.sql.parquet.binaryAsString=true
来解决spark-sql以及beeline中的问题,在spark1.2.0版本中该参数默认值为false;
说明:Some other Parquet-producing systems, in particular Impala and older versions of Spark SQL, do not differentiate between binary data and strings when writing out the Parquet schema. This flag tells Spark SQL to interpret binary data as a string to provide compatibility with these systems.
相关文章推荐
- sql server table类型的变量使用注意事项
- 常用sql命令@oracle数据类型概括@权限、角色、用户的创建于使用@伪列及其注意事项
- 常用sql命令@oracle数据类型概括@权限、角色、用户的创建于使用@伪列及其注意事项
- Hibernate使用sql语句查询,返回实体类型的方法及注意事项
- SQL中BCP的使用注意事项
- .NET 2.0 SQL依赖注意事项(转载:原文《使用SQL Server 2005 Query Notification的几个注意事项》)
- 在oracle中字段类型LONG的使用注意事项
- sqlca.SynTaxFromSql 使用注意事项
- 在oracle中字段类型LONG的使用注意事项
- 使用Tortoise SVN版本控制Android项目in eclipse的注意事项
- pthread 静态编译版本在Windows下使用时的注意事项
- [转]sql中Distinct、Group by、having、order by使用注意事项
- 免安装Oracle客户端使用PL/SQL连接Linux Oracle 注意事项
- 在oracle中字段类型LONG的使用注意事项
- sql 函数的使用注意事项
- 关于SQL中表的别名使用注意事项
- 使用SqlDependency监测SQL Server 2005/2008字段改动时的SQL语法及相关注意事项
- 分页解决方案 之 分页算法——Pager_SQL的详细使用方法和注意事项
- 在T-SQL中使用临时表的注意事项
- 分页解决方案 之 分页算法——Pager_SQL的详细使用方法和注意事项