This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testArrayOfRecords() throws Exception { | |
Schema innerRecord = Schema.createRecord("InnerRecord", null, null, false); | |
Schema optionalString = optional(Schema.create(Schema.Type.STRING)); | |
innerRecord.setFields(Lists.newArrayList( | |
new Schema.Field("s1", optionalString, null, NullNode.getInstance()), | |
new Schema.Field("s2", optionalString, null, NullNode.getInstance()) | |
)); | |
Schema schema = Schema.createRecord("HasArray", null, null, false); | |
schema.setFields(Lists.newArrayList( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type" : "record", | |
"name" : "Movie", | |
"doc" : "Schema generated by Kite", | |
"fields" : [ { | |
"name" : "id", | |
"type" : "long" | |
}, { | |
"name" : "title", | |
"type" : [ "null", "string" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2013 Cloudera Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Creates a copy of this {@code View} for entities of the given type class. | |
* | |
* @param type a Java Class to use for entities | |
* @return a copy of this view for the given type | |
* @throws org.kitesdk.data.IncompatibleSchemaException | |
* If the schema for {@code type} is incompatible with the | |
* underlying dataset's Schema. | |
*/ | |
<T> RefinableView<T> asType(Class<T> type); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.nio.ByteBuffer; | |
import java.util.Comparator; | |
public class Comparators { | |
public static Comparator<ByteBuffer> unsignedBytes() { | |
return UnsignedByteBufComparator.INSTANCE; | |
} | |
public static Comparator<ByteBuffer> signedBytes() { | |
return Comparator.naturalOrder(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Licensed to the Apache Software Foundation (ASF) under one or more | |
* contributor license agreements. See the NOTICE file distributed with | |
* this work for additional information regarding copyright ownership. | |
* The ASF licenses this file to You under the Apache License, Version 2.0 | |
* (the "License"); you may not use this file except in compliance with | |
* the License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Licensed to the Apache Software Foundation (ASF) under one or more | |
* contributor license agreements. See the NOTICE file distributed with | |
* this work for additional information regarding copyright ownership. | |
* The ASF licenses this file to You under the Apache License, Version 2.0 | |
* (the "License"); you may not use this file except in compliance with | |
* the License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Interface used to write a [[Dataset]] to external storage using the v2 API. | |
* | |
* @since 3.0.0 | |
*/ | |
@Experimental | |
final class DataFrameWriterV2[T] private[sql](table: String, ds: Dataset[T]) | |
extends CreateTableWriter[T] with LookupCatalog { | |
import org.apache.spark.sql.catalog.v2.CatalogV2Implicits._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The base physical plan for writing data into data source v2. | |
*/ | |
abstract class V2TableWriteExec( | |
options: Map[String, String], | |
query: SparkPlan) extends SparkPlan { | |
import org.apache.spark.sql.sources.v2.DataSourceV2Implicits._ | |
def partitioning: Seq[PartitionTransform] | |
override def children: Seq[SparkPlan] = Seq(query) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.apache.iceberg.types; | |
import java.util.List; | |
import org.apache.iceberg.Schema; | |
import org.apache.iceberg.relocated.com.google.common.collect.Lists; | |
public abstract class SchemaWithPartnerVisitor<P, R> { | |
public interface PartnerAccessors<P> { | |
P fieldPartner(P partnerStruct, int fieldId, String name); | |
P mapKeyPartner(P partnerMap); |
OlderNewer