title: Load Apache Spark Dataset<Row> to DynamoDB Table using Java
body: <p>our application creates parquet file and we need to load this data to DynamoDB. I am not finding any Java examples using emr-dynamodb-connector. How do we convert Dataset data to hadoopRDD or DynamoDBItemWritable? Appreciate help. Not finding good documentation on emr-dynamodb-connector either. </p>
  
  <pre><code>//Read file
  Dataset&lt;Row&gt; parquetFileDF = spark.read().parquet("/src/main/resources/account.parquet");
  
  //Create hadoop RDD using above data ( Need to figure out this part)
  JavaPairRDD&lt;Text, DynamoDBItemWritable&gt; hadoopRDD = sc.hadoopRDD(jobConf,
                  DynamoDBInputFormat.class, Text.class, DynamoDBItemWritable.class);
  
  //Save
  hadoopRDD.saveAsHadoopDataset(jobConf);
  
  private static JobConf getDynamoDbJobConf (JavaSparkContext sc, String tableNameForWrite){
          final JobConf jobConf = new JobConf(sc.hadoopConfiguration());
          jobConf.set("dynamodb.servicename", "dynamodb");
          jobConf.set("dynamodb.input.tableName", tableNameForWrite);
          jobConf.set("dynamodb.endpoint", "dynamodb.us-east-1.amazonaws.com");
          jobConf.set("dynamodb.regionid", "us-east-1");
          jobConf.set("dynamodb.proxy.hostname", "");
          jobConf.set("dynamodb.proxy.port", "");
          jobConf.set("mapred.output.format.class",
                  "org.apache.hadoop.dynamodb.write.DynamoDBOutputFormat");
          jobConf.set("mapred.input.format.class",
                  "org.apache.hadoop.dynamodb.read.DynamoDBInputFormat");
          //jobConf.set("dynamodb.customAWSCredentialsProvider", profile);
          return jobConf;
      }
  
  </code></pre>