Spark-sql-row
来源:互联网 发布:linux下安装apache 编辑:程序博客网 时间:2024/06/10 07:07
Spark-sql-row
@(spark)[sql|row]
Row
row就是关系数据库中的一行。
/** * Represents one row of output from a relational operator. Allows both generic access by ordinal, * which will incur boxing overhead for primitives, as well as native primitive access. * * It is invalid to use the native primitive interface to retrieve a value that is null, instead a * user must check `isNullAt` before attempting to retrieve a value that might be null. * * To create a new Row, use [[RowFactory.create()]] in Java or [[Row.apply()]] in Scala. * * A [[Row]] object can be constructed by providing field values. Example: * {{{ * import org.apache.spark.sql._ * * // Create a Row from values. * Row(value1, value2, value3, ...) * // Create a Row from a Seq of values. * Row.fromSeq(Seq(value1, value2, ...)) * }}} * * A value of a row can be accessed through both generic access by ordinal, * which will incur boxing overhead for primitives, as well as native primitive access. * An example of generic access by ordinal: * {{{ * import org.apache.spark.sql._ * * val row = Row(1, true, "a string", null) * // row: Row = [1,true,a string,null] * val firstValue = row(0) * // firstValue: Any = 1 * val fourthValue = row(3) * // fourthValue: Any = null * }}} * * For native primitive access, it is invalid to use the native primitive interface to retrieve * a value that is null, instead a user must check `isNullAt` before attempting to retrieve a * value that might be null. * An example of native primitive access: * {{{ * // using the row from the previous example. * val firstValue = row.getInt(0) * // firstValue: Int = 1 * val isNull = row.isNullAt(3) * // isNull: Boolean = true * }}} * * In Scala, fields in a [[Row]] object can be extracted in a pattern match. Example: * {{{ * import org.apache.spark.sql._ * * val pairs = sql("SELECT key, value FROM src").rdd.map { * case Row(key: Int, value: String) => * key -> value * } * }}} * * * * @group row */ trait Row extends Serializable {
0 0
- Spark-sql-row
- Spark 之 Row
- Spark-Sql源码解析之七 Execute: executed Plan -> RDD[Row]
- spark2.2错误 java.lang.UnsupportedOperationException: No Encoder found for org.apache.spark.sql.Row解决
- Spark基本操作SparkSession,Dataset<Row>,JavaRDD<Row>
- Spark Streaming+Spark SQL
- spark sql
- Spark SQL
- Spark SQL
- spark-sql
- spark sql
- spark sql
- spark sql
- Spark-Sql
- Spark SQL
- Spark SQL
- spark Sql
- spark-sql
- 第三章第36题
- Spark-deploy
- spark-sql-readme
- spark-sql-catalyst
- DuiVision开发教程(12)-任务类和任务队列
- Spark-sql-row
- 分类器
- Spark-SQL-core
- Firebird 全局临时表
- 奇异值分解及应用(PCA&LSA)
- ActiveX 学习笔记 (一)
- 杭电ACM2187——悼念512汶川大地震遇难同胞——老人是真饿了~~贪心
- Spring 之注解事务 @Transactional
- 猫猫学iOS(四十八)多线程网络之多线程简单了解