File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
external/maprdb/src/main/scala/com/mapr/db/spark/sql Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -62,16 +62,16 @@ class DefaultSource
6262 parameters : Map [String , String ],
6363 data : DataFrame ): BaseRelation = {
6464
65- require(parameters.get( " tableName " ).isDefined)
66- require(parameters.get(" idFieldPath " ).isDefined)
67- val idFieldPath = parameters(" idFieldPath" )
65+
66+ require(parameters.get(" tableName " ).isDefined, " Table name must be defined " )
67+ val idFieldPath = parameters.getOrElse (" idFieldPath" , " _id " )
6868 val condition : Option [QueryCondition ] = parameters
6969 .get(" QueryCondition" )
7070 .map(cond => ConditionImpl .parseFrom(ByteBuffer .wrap(cond.getBytes)))
7171 lazy val tableExists =
7272 DBClient ().tableExists(parameters(" tableName" ))
7373 lazy val tableName = parameters(" tableName" )
74- lazy val createTheTable = if ( tableExists) false else true
74+ lazy val createTheTable = ! tableExists
7575 lazy val bulkMode = parameters.getOrElse(" bulkMode" , " false" ).toBoolean
7676 val operation = parameters.getOrElse(" Operation" , " ErrorIfExists" )
7777 mode match {
You can’t perform that action at this time.
0 commit comments