GitHub user Sssan520 opened a pull request:
https://github.com/apache/carbondata/pull/2656
[ExternalFormat] block some operations on external format table
These operations will be blocked:
1. update data on external format table
2. delete data on external format table
3. add columns on external format table
4. drop columns on external format table
5. change column datatype on external format table
6. create external format table if table columns not in format.header
And add external format information for command 'desc formatted table',
e.g.
CREATE TABLE fact_carbon_csv_table(empname String, empno int, designation
string)
STORED BY 'carbondata'
TBLPROPERTIES(
'format'='csv',
'csv.header'='empno, empname, designation, salary',
'csv.delimiter'='|'
)
desc formatted fact_carbon_csv_table:
+--------------------------------------+--------------------------------------------+
|col_name |data_type
|
+--------------------------------------+--------------------------------------------+
|empname |string
|
|empno |int
|
|designation |string
|
| |
|
|##Detailed Table Information |
|
|Database Name |default
|
|Table Name |fact_carbon_csv_table
|
|CARBON Store Path
|D:/projects/IdeaProjects/carbondata/........|
|Comment |
|
|Table Block Size |1024 MB
|
|Table Data Size |0
|
|Table Index Size |0
|
|Last Update Time |0
|
|SORT_SCOPE |LOCAL_SORT
|
|CACHE_LEVEL |BLOCK
|
|Streaming |false
|
|Local Dictionary Enabled |false
|
| |
|
|##Detailed External-Format Information|
|
|format |csv
|
|csv.delimiter ||
|
|csv.header |empno,empname,designation,salary
|
| |
|
|##Detailed Column property |
|
|ADAPTIVE |
|
|SORT_COLUMNS |empname,designation
|
+--------------------------------------+--------------------------------------------+
Be sure to do all of the following checklist to help us incorporate
your contribution quickly and easily:
- [x] Any interfaces changed?
No
- [x] Any backward compatibility impacted?
No
- [x] Document update required?
No
- [x] Testing done
Please provide details on
- Whether new unit test cases have been added or why no new tests
are required?
- How it is tested? Please attach test report.
- Is it a performance related change? Please attach the performance
test report.
- Any additional information to help reviewers in testing this
change.
has added test case.
- [x] For large changes, please consider breaking it into sub-tasks under
an umbrella JIRA.
NA
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/Sssan520/carbondata external-format-ddl
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/carbondata/pull/2656.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2656
----
commit 3b501f9bf5aa4319084a857f4f955b3c017a27ac
Author: Sssan520 <liangap2008@...>
Date: 2018-07-02T11:12:24Z
[external-format] block some ddl,dml operations on external table
----
---