Skip to content

Commit

Permalink
[HUDI-4763] Allow hoodie read client to choose index (apache#6506)
Browse files Browse the repository at this point in the history
Co-authored-by: Y Ethan Guo <ethan.guoyihua@gmail.com>
  • Loading branch information
parisni and yihua committed Sep 10, 2022
1 parent 43bd60b commit 28a1016
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@ public HoodieReadClient(HoodieSparkEngineContext context, String basePath, SQLCo
this.sqlContextOpt = Option.of(sqlContext);
}

/**
* Initializes the {@link HoodieReadClient} with engine context, base path, SQL context and index type.
*
* @param context Hudi Spark engine context
* @param basePath Base path of the table
* @param sqlContext {@link SQLContext} instance
* @param indexType Hudi index type
*/
public HoodieReadClient(HoodieSparkEngineContext context, String basePath, SQLContext sqlContext, HoodieIndex.IndexType indexType) {
this(context, HoodieWriteConfig.newBuilder().withPath(basePath)
.withIndexConfig(HoodieIndexConfig.newBuilder().withIndexType(indexType).build()).build());
this.sqlContextOpt = Option.of(sqlContext);
}

/**
* @param clientConfig instance of HoodieWriteConfig
*/
Expand Down

0 comments on commit 28a1016

Please sign in to comment.