Skip to content

Commit

Permalink
[Doc]Fix typo for Quick-Start This closes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
chenliang613 committed Jul 6, 2016
2 parents 39d45f7 + 3163896 commit d94cf2e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/Quick-Start.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,14 @@ $ ./bin/spark-shell --master local --jars ${carbondata_jar},${mysql_jar}
import org.apache.spark.sql.CarbonContext
import java.io.File
import org.apache.hadoop.hive.conf.HiveConf
val cc = new CarbonContext(sc, "./carbondata/store")
val storePath = "hdfs://hacluster/Opt/CarbonStore"
val cc = new CarbonContext(sc, storePath)
cc.setConf("carbon.kettle.home","./carbondata/carbonplugins")
val metadata = new File("").getCanonicalPath + "/carbondata/metadata"
cc.setConf("hive.metastore.warehouse.dir", metadata)
cc.setConf(HiveConf.ConfVars.HIVECHECKFILEFORMAT.varname, "false")
```
*Note*: `storePath` can be a hdfs path or a local path , the path is used to store table data.

* Create table

Expand All @@ -92,9 +94,11 @@ val dataFilePath = new File("").getCanonicalPath + "/carbondata/sample.csv"
cc.sql(s"load data inpath '$dataFilePath' into table table1")
```

Note: Carbondata also support `LOAD DATA LOCAL INPATH 'folder_path' INTO TABLE [db_name.]table_name OPTIONS(property_name=property_value, ...)` syntax, but right now there is no significant meaning to local in carbondata.We just keep it to align with hive syntax. `dataFilePath` can be hdfs path as well like `val dataFilePath = hdfs://hacluster//carbondata/sample.csv`

* Query data from table1

```
cc.sql("select * from table1").show
cc.sql("select city, avg(age), sum(age) from table1 group by city").show
```
```

0 comments on commit d94cf2e

Please sign in to comment.