本文整理汇总了Scala中org.apache.spark.sql.catalyst.catalog.CatalogTable类的典型用法代码示例。如果您正苦于以下问题:Scala CatalogTable类的具体用法?Scala CatalogTable怎么用?Scala CatalogTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CatalogTable类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Scala代码示例。
示例1: ModelSerSpec
//设置package包名称以及导入依赖的类
package org.apache.spark.sql.crossdata.catalyst.catalog.persistent.zookeeper
import org.apache.spark.sql.catalyst.TableIdentifier
import org.apache.spark.sql.catalyst.catalog.{CatalogStorageFormat, CatalogTable, CatalogTableType}
import org.apache.spark.sql.crossdata.catalyst.catalog.persistent.models.TableModel
import org.apache.spark.sql.crossdata.serializers.XDSerializationTest.TestCase
import org.apache.spark.sql.crossdata.serializers.{CrossdataCommonSerializer, StructTypeSerializer, XDSerializationTest}
import org.apache.spark.sql.types.{StringType, StructField, StructType}
import org.json4s.{DefaultFormats, Formats}
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class ModelSerSpec extends XDSerializationTest[TableModel] with CrossdataCommonSerializer {
override implicit val formats: Formats = json4sJacksonFormats
lazy val table = "tableA"
lazy val db = "databaseA"
lazy val model = TableModel(CatalogTable(
TableIdentifier(table, Some(db)),
CatalogTableType.EXTERNAL,
CatalogStorageFormat.empty,
new StructType(Array(StructField("field1", StringType)))
))
override def testCases: Seq[TestCase] = Seq(
TestCase("marshall & unmarshall TableModel instances", model)
)
}