Skip to content
This repository was archived by the owner on Mar 10, 2025. It is now read-only.

Commit 3b43809

Browse files
committed
Fix of unusable method if DataFrame wanted instead of DataFrameStreaming.
1 parent 4de6a15 commit 3b43809

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ limitations under the License.
7272
<dependency>
7373
<groupId>com.microsoft.azure</groupId>
7474
<artifactId>documentdb-bulkexecutor</artifactId>
75-
<version>2.4.3-SNAPSHOT</version>
75+
<version>2.5.0</version>
7676
</dependency>
7777
<dependency>
7878
<groupId>junit</groupId>

src/main/scala/com/microsoft/azure/cosmosdb/spark/schema/DataFrameReaderFunctions.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ private[spark] case class DataFrameReaderFunctions(@transient dfr: DataFrameRead
6464
* @return DataFrame
6565
*/
6666
def cosmosDB[T <: Product : TypeTag](readConfig: Config): DataFrame =
67-
createCosmosDBDataFrame(InferSchema.reflectSchema[T](), Some(readConfig), None)
67+
createCosmosDBDataFrame(InferSchema.reflectSchema[T](), Option(readConfig), None)
6868

6969
/**
7070
* Creates a [[DataFrame]] with the set schema
7171
*
7272
* @param schema the schema definition
7373
* @return DataFrame
7474
*/
75-
def cosmosDB(schema: StructType): DataFrame = createCosmosDBDataFrame(Some(schema), None, None)
75+
def cosmosDB(schema: StructType): DataFrame = createCosmosDBDataFrame(Option(schema), None, None)
7676

7777
/**
7878
* Creates a [[DataFrame]] with the set schema
@@ -81,7 +81,7 @@ private[spark] case class DataFrameReaderFunctions(@transient dfr: DataFrameRead
8181
* @param readConfig any custom read configuration
8282
* @return DataFrame
8383
*/
84-
def cosmosDB(schema: StructType, readConfig: Config, sqlContext: SQLContext): DataFrame = createCosmosDBDataFrame(Some(schema), Some(readConfig), Some(sqlContext))
84+
def cosmosDB(schema: StructType, readConfig: Config, sqlContext: SQLContext): DataFrame = createCosmosDBDataFrame(Option(schema), Option(readConfig), Option(sqlContext))
8585

8686
private def createDataFrame(schema: Option[StructType], readConfig: Option[Config], sqlContext: Option[SQLContext]): DataFrame = {
8787
var cachingMode: CachingMode = CachingMode.NONE
@@ -135,12 +135,12 @@ private[spark] case class DataFrameReaderFunctions(@transient dfr: DataFrameRead
135135
.-(CosmosDBConfig.RollingChangeFeed)
136136
.-(CosmosDBConfig.CachingModeParam)
137137
.+((CosmosDBConfig.CachingModeParam, CachingMode.CACHE.toString)))
138-
val df = createDataFrame(schema, Some(dfConfig), sqlContext)
138+
val df = createDataFrame(schema, Option(dfConfig), sqlContext)
139139

140140
val changeFeedConfig = Config(dfConfig.asOptions
141141
.+((CosmosDBConfig.ReadChangeFeed, "true"))
142142
.-(CosmosDBConfig.CachingModeParam))
143-
val changeFeedDf = createDataFrame(schema, Some(changeFeedConfig), sqlContext)
143+
val changeFeedDf = createDataFrame(schema, Option(changeFeedConfig), sqlContext)
144144

145145
df.union(changeFeedDf)
146146
} else {

0 commit comments

Comments
 (0)