Github user sgururajshetty commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2198#discussion_r183615513
  
    --- Diff: docs/data-management-on-carbondata.md ---
    @@ -174,6 +174,50 @@ This tutorial is going to introduce all commands and 
data operations on CarbonDa
     
       ```
     
    +## CREATE EXTERNAL TABLE
    +  This function allows user to create external table by specifying 
location.
    +  ```
    +  CREATE EXTERNAL TABLE [IF NOT EXISTS] [db_name.]table_name 
    +  STORED BY 'carbondata' LOCATION ‘$FilesPath’
    +  ```
    +  
    +### Create external table on managed table data location.
    +  Managed table data location provided will have both FACT and Metadata 
folder. 
    +  This data can be generated by creating a normal carbon table and use 
this path as $FilesPath in the above syntax.
    +  
    +  **Example:**
    +  ```
    +  sql("CREATE TABLE origin(key INT, value STRING) STORED BY 'carbondata'")
    +  sql("INSERT INTO origin select 100,'spark'")
    +  sql("INSERT INTO origin select 200,'hive'")
    +  // creates a table in $storeLocation/origin
    +  
    +  sql(s"""
    +  |CREATE EXTERNAL TABLE source
    +  |STORED BY 'carbondata'
    +  |LOCATION '$storeLocation/origin'
    +  """.stripMargin)
    +  checkAnswer(sql("SELECT count(*) from source"), sql("SELECT count(*) 
from origin"))
    +  ```
    +  
    +### Create external table on Non-Transactional table data location.
    --- End diff --
    
    There > there


---

Reply via email to