fixed some minor linking issues
Project: http://git-wip-us.apache.org/repos/asf/incubator-carbondata-site/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-carbondata-site/commit/b00a58bf Tree: http://git-wip-us.apache.org/repos/asf/incubator-carbondata-site/tree/b00a58bf Diff: http://git-wip-us.apache.org/repos/asf/incubator-carbondata-site/diff/b00a58bf Branch: refs/heads/asf-site Commit: b00a58bfd9bc8b801d1e0e8f8ead4d3581c194c3 Parents: 54e179b Author: PallaviSingh1992 <[email protected]> Authored: Fri Apr 7 16:47:38 2017 +0530 Committer: PallaviSingh1992 <[email protected]> Committed: Fri Apr 7 16:47:38 2017 +0530 ---------------------------------------------------------------------- src/main/scala/FileModification.scala | 9 ++-- src/main/scala/MdFilehandler.scala | 14 +++++ .../webapp/ddl-operation-on-carbondata.html | 56 ++++++++++++++++++++ src/main/webapp/installation-guide.html | 4 +- src/main/webapp/mainpage.html | 51 +++++++++--------- src/main/webapp/quick-start-guide.html | 30 +++++------ 6 files changed, 115 insertions(+), 49 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-carbondata-site/blob/b00a58bf/src/main/scala/FileModification.scala ---------------------------------------------------------------------- diff --git a/src/main/scala/FileModification.scala b/src/main/scala/FileModification.scala index 2cbfd73..3d8c969 100644 --- a/src/main/scala/FileModification.scala +++ b/src/main/scala/FileModification.scala @@ -28,18 +28,21 @@ class FileModification { val listOfFiles = readListOfFiles() val statusList = listOfFiles.map { file => val fileURLContent = scala.io.Source.fromURL(url + file + inputFileExtension).mkString - val getFileData = fileReadObject.getFileContent(fileURLContent) + val getFileData: Option[String] = fileReadObject.getFileContent(fileURLContent) getFileData match { case Some(data: String) => val fileData = fileReadObject.ConvertMdExtension(data) - logger.info("Begin writing [" + file + "." + outputFileExtension + "] at " + location) + logger.info("Begin writing [" + file + outputFileExtension + "] at " + location) writeToFile(location + file + outputFileExtension, fileData) - logger.info("Successfully written [" + file + "." + outputFileExtension + "] at " + location) + logger.info("Successfully written [" + file + outputFileExtension + "] at " + location) "Success" case None => logger.error(s"$file Conversion failed ") "Failure" } } + fileReadObject.ConvertReadMeExtension() + logger.info("Restored back the ReadMe.md file extension in Installation Guide") + if (statusList.contains("Failure")) "Some Files Failed To Convert" else http://git-wip-us.apache.org/repos/asf/incubator-carbondata-site/blob/b00a58bf/src/main/scala/MdFilehandler.scala ---------------------------------------------------------------------- diff --git a/src/main/scala/MdFilehandler.scala b/src/main/scala/MdFilehandler.scala index afb427a..d7cb193 100644 --- a/src/main/scala/MdFilehandler.scala +++ b/src/main/scala/MdFilehandler.scala @@ -1,3 +1,5 @@ +import java.io.{File, PrintWriter} + import com.typesafe.config.ConfigFactory import org.apache.http.HttpResponse import org.apache.http.client.methods.HttpPost @@ -35,6 +37,18 @@ class MdFilehandler { contentAfterReplacingFileLink } + def ConvertReadMeExtension(): String = { + val location = ConfigFactory.load().getString("outputFileLocation") + val outputFileExtension = ".html" + val modifyMdPattern = new Regex("(README)(.html)") + val fileURLContent = scala.io.Source.fromFile("src/main/webapp/installation-guide.html").mkString + val writer = new PrintWriter(new File(location + "installation-guide" + outputFileExtension)) + val fileContent = modifyMdPattern replaceAllIn(fileURLContent, "$1.md") + writer.write(fileContent) + writer.close() + fileContent + } + /** * gets content of the file through rest call * http://git-wip-us.apache.org/repos/asf/incubator-carbondata-site/blob/b00a58bf/src/main/webapp/ddl-operation-on-carbondata.html ---------------------------------------------------------------------- diff --git a/src/main/webapp/ddl-operation-on-carbondata.html b/src/main/webapp/ddl-operation-on-carbondata.html index 5923a67..4de5a4a 100644 --- a/src/main/webapp/ddl-operation-on-carbondata.html +++ b/src/main/webapp/ddl-operation-on-carbondata.html @@ -173,6 +173,7 @@ <li><a href="#drop-table">DROP TABLE</a></li> <li><a href="#compaction">COMPACTION</a></li> <li><a href="#bucketing">BUCKETING</a></li> +<li><a href="#table-rename">TABLE RENAME</a></li> </ul> <h2> @@ -506,6 +507,61 @@ of columns is used.</p> 'BUCKETNUMBER'='4', 'BUCKETCOLUMNS'='productName') </code></pre> + +<h2> +<a id="table-rename" class="anchor" href="#table-rename" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>TABLE RENAME</h2> + +<p>This command is used to rename the existing table.</p> + +<h3> +<a id="syntax-1" class="anchor" href="#syntax-1" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Syntax</h3> + +<pre><code> ALTER TABLE [db_name.]table_name RENAME TO new_table_name; +</code></pre> + +<h3> +<a id="parameter-description-5" class="anchor" href="#parameter-description-5" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Parameter Description</h3> + +<table> +<thead> +<tr> +<th>Parameter</th> +<th>Description</th> +</tr> +</thead> +<tbody> +<tr> +<td>db_name</td> +<td>Name of the database. If this parameter is left unspecified, the current database is selected.</td> +</tr> +<tr> +<td>table_name</td> +<td>Name of the existing table.</td> +</tr> +<tr> +<td>new_table_name</td> +<td>New table name for the existing table.</td> +</tr> +</tbody> +</table> + +<h3> +<a id="usage-guidelines-2" class="anchor" href="#usage-guidelines-2" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Usage Guidelines</h3> + +<p>Following conditions must be met for successful rename operation:</p> + +<ul> +<li>Queries running in parallel which requires the formation of path using the table name for reading carbon store files might fail during this operation.</li> +<li>Secondary index table rename is not permitted.</li> +</ul> + +<h3> +<a id="example-3" class="anchor" href="#example-3" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Example:</h3> + +<pre><code> ALTER TABLE carbon RENAME TO carbondata; + + ALTER TABLE test_db.carbon RENAME TO test_db.carbondata; +</code></pre> </div> </div> </div> http://git-wip-us.apache.org/repos/asf/incubator-carbondata-site/blob/b00a58bf/src/main/webapp/installation-guide.html ---------------------------------------------------------------------- diff --git a/src/main/webapp/installation-guide.html b/src/main/webapp/installation-guide.html index e98ce82..c13946f 100644 --- a/src/main/webapp/installation-guide.html +++ b/src/main/webapp/installation-guide.html @@ -189,7 +189,7 @@ <a id="procedure" class="anchor" href="#procedure" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Procedure</h3> <ol> -<li><p><a href="https://github.com/apache/incubator-carbondata/blob/master/build/README.html" target=_blank>Build the CarbonData</a> project and get the assembly jar from <code>./assembly/target/scala-2.1x/carbondata_xxx.jar</code>. </p></li> +<li><p><a href="https://github.com/apache/incubator-carbondata/blob/master/build/README.md" target=_blank>Build the CarbonData</a> project and get the assembly jar from <code>./assembly/target/scala-2.1x/carbondata_xxx.jar</code>. </p></li> <li> <p>Copy <code>./assembly/target/scala-2.1x/carbondata_xxx.jar</code> to <code>$SPARK_HOME/carbonlib</code> folder.</p> @@ -281,7 +281,7 @@ <ol> <li> -<p><a href="https://github.com/apache/incubator-carbondata/blob/master/build/README.html" target=_blank>Build the CarbonData</a> project and get the assembly jar from <code>./assembly/target/scala-2.1x/carbondata_xxx.jar</code> and copy to <code>$SPARK_HOME/carbonlib</code> folder.</p> +<p><a href="https://github.com/apache/incubator-carbondata/blob/master/build/README.md" target=_blank>Build the CarbonData</a> project and get the assembly jar from <code>./assembly/target/scala-2.1x/carbondata_xxx.jar</code> and copy to <code>$SPARK_HOME/carbonlib</code> folder.</p> <p><strong>NOTE</strong>: Create the carbonlib folder if it does not exists inside <code>$SPARK_HOME</code> path.</p> </li> http://git-wip-us.apache.org/repos/asf/incubator-carbondata-site/blob/b00a58bf/src/main/webapp/mainpage.html ---------------------------------------------------------------------- diff --git a/src/main/webapp/mainpage.html b/src/main/webapp/mainpage.html index 16c511f..5c0b627 100644 --- a/src/main/webapp/mainpage.html +++ b/src/main/webapp/mainpage.html @@ -168,29 +168,28 @@ </span> <hr style="margin: 12px 0 8px"> <div> - - <ul class="sub-nav"> - <li><a href="quick-start-guide.html">Quick - Start</a></li> - <li><a href="https://cwiki.apache.org/confluence/display/CARBONDATA/CarbonData+Introduction" target="_blank">Introduction - and Features</a></li> - <li><a href="supported-data-types-in-carbondata.html">Data - Types</a></li> - <li><a href="installation-guide.html">CarbonData - Installation Guide</a></a></li> - <li><a href="configuration-parameters.html">Configuring - CarbonData</a></li> - <li><a href="data-management.html">Using - CarbonData and Data Management</a></li> - <li><a href="ddl-operation-on-carbondata.html">Data - Definition Language Support</a></li> - <li><a href="dml-operation-on-carbondata.html">Data - Manipulation Language Support</a></li> - <li><a href="useful-tips-on-carbondata.html">Useful - Tips</a></li> - <li><a href="troubleshooting.html">Troubleshooting</a></li> - <li><a href="faq.html">FAQs</a></li> - </ul> + <ul class="sub-nav"> + <li><a href="quick-start-guide.html">Quick + Start</a></li> + <li><a href="file-structure-of-carbondata.html">CarbonData + File Structure</a></li> + <li><a href="supported-data-types-in-carbondata.html">Data + Types</a></li> + <li><a href="data-management.html">Data + Management</a></li> + <li><a href="ddl-operation-on-carbondata.html">DDL + Operations on CarbonData</a></li> + <li><a href="dml-operation-on-carbondata.html">DML + Operations on CarbonData</a></li> + <li><a href="installation-guide.html">Cluster + Installation and Deployment</a></li> + <li><a href="configuration-parameters.html">Configuring + CarbonData</a></li> + <li><a href="faq.html">FAQs</a></li> + <li><a href="troubleshooting.html">Troubleshooting</a></li> + <li><a href="useful-tips-on-carbondata.html">Useful + Tips</a></li> + </ul> </div> </div> </div> @@ -204,9 +203,9 @@ </div> </div> </section><!-- End systemblock part --> - </div> - </div> - </div> +</div> +</div> +</div> </section><!-- End systemblock part --> <script src="js/custom.js"></script> </body> http://git-wip-us.apache.org/repos/asf/incubator-carbondata-site/blob/b00a58bf/src/main/webapp/quick-start-guide.html ---------------------------------------------------------------------- diff --git a/src/main/webapp/quick-start-guide.html b/src/main/webapp/quick-start-guide.html index e4be074..08b896b 100644 --- a/src/main/webapp/quick-start-guide.html +++ b/src/main/webapp/quick-start-guide.html @@ -183,10 +183,7 @@ EOF </ul> <h2> -<a id="interactive-analysis-with-spark-shell" class="anchor" href="#interactive-analysis-with-spark-shell" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Interactive Analysis with Spark Shell</h2> - -<h2> -<a id="version-21" class="anchor" href="#version-21" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Version 2.1</h2> +<a id="interactive-analysis-with-spark-shell-version-21" class="anchor" href="#interactive-analysis-with-spark-shell-version-21" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Interactive Analysis with Spark Shell Version 2.1</h2> <p>Apache Spark Shell provides a simple way to learn the API, as well as a powerful tool to analyze data interactively. Please visit <a href="http://spark.apache.org/docs/latest/" target=_blank>Apache Spark Documentation</a> for more details on Spark shell.</p> @@ -222,14 +219,14 @@ import org.apache.spark.sql.CarbonSession._ <h4> <a id="executing-queries" class="anchor" href="#executing-queries" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Executing Queries</h4> -<h5> -<a id="creating-a-table" class="anchor" href="#creating-a-table" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Creating a Table</h5> +<h6> +<a id="creating-a-table" class="anchor" href="#creating-a-table" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Creating a Table</h6> <pre><code>scala>carbon.sql("CREATE TABLE IF NOT EXISTS test_table(id string, name string, city string, age Int) STORED BY 'carbondata'") </code></pre> -<h5> -<a id="loading-data-to-a-table" class="anchor" href="#loading-data-to-a-table" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Loading Data to a Table</h5> +<h6> +<a id="loading-data-to-a-table" class="anchor" href="#loading-data-to-a-table" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Loading Data to a Table</h6> <pre><code>scala>carbon.sql("LOAD DATA INPATH 'sample.csv file path' INTO TABLE test_table") </code></pre> @@ -245,10 +242,7 @@ scala>carbon.sql("SELECT city, avg(age), sum(age) FROM test_table GROUP BY ci </code></pre> <h2> -<a id="interactive-analysis-with-spark-shell-1" class="anchor" href="#interactive-analysis-with-spark-shell-1" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Interactive Analysis with Spark Shell</h2> - -<h2> -<a id="version-16" class="anchor" href="#version-16" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Version 1.6</h2> +<a id="interactive-analysis-with-spark-shell-version-16" class="anchor" href="#interactive-analysis-with-spark-shell-version-16" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Interactive Analysis with Spark Shell Version 1.6</h2> <h4> <a id="basics-1" class="anchor" href="#basics-1" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Basics</h4> @@ -279,8 +273,8 @@ scala>carbon.sql("SELECT city, avg(age), sum(age) FROM test_table GROUP BY ci <h4> <a id="executing-queries-1" class="anchor" href="#executing-queries-1" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Executing Queries</h4> -<h5> -<a id="creating-a-table-1" class="anchor" href="#creating-a-table-1" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Creating a Table</h5> +<h6> +<a id="creating-a-table-1" class="anchor" href="#creating-a-table-1" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Creating a Table</h6> <pre><code>scala>cc.sql("CREATE TABLE IF NOT EXISTS test_table (id string, name string, city string, age Int) STORED BY 'carbondata'") </code></pre> @@ -290,16 +284,16 @@ scala>carbon.sql("SELECT city, avg(age), sum(age) FROM test_table GROUP BY ci <pre><code>scala>cc.sql("SHOW TABLES").show() </code></pre> -<h5> -<a id="loading-data-to-a-table-1" class="anchor" href="#loading-data-to-a-table-1" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Loading Data to a Table</h5> +<h6> +<a id="loading-data-to-a-table-1" class="anchor" href="#loading-data-to-a-table-1" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Loading Data to a Table</h6> <pre><code>scala>cc.sql("LOAD DATA INPATH 'sample.csv file path' INTO TABLE test_table") </code></pre> <p><strong>NOTE</strong>: Please provide the real file path of <code>sample.csv</code> for the above script.</p> -<h5> -<a id="query-data-from-a-table-1" class="anchor" href="#query-data-from-a-table-1" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Query Data from a Table</h5> +<h6> +<a id="query-data-from-a-table-1" class="anchor" href="#query-data-from-a-table-1" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Query Data from a Table</h6> <pre><code>scala>cc.sql("SELECT * FROM test_table").show() scala>cc.sql("SELECT city, avg(age), sum(age) FROM test_table GROUP BY city").show()
