[ https://issues.apache.org/jira/browse/CARBONDATA-2580?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] xubo245 updated CARBONDATA-2580: -------------------------------- Issue Type: Sub-task (was: Bug) Parent: CARBONDATA-2628 > MV Datamap - Cannot create two MV`s with same name in different databases. > -------------------------------------------------------------------------- > > Key: CARBONDATA-2580 > URL: https://issues.apache.org/jira/browse/CARBONDATA-2580 > Project: CarbonData > Issue Type: Sub-task > Components: data-load, data-query > Environment: 3 Node Opensource ANT cluster > Reporter: Prasanna Ravichandran > Priority: Minor > Labels: CARBONDATA., MV, Materialistic_Views > > Cannot create two MV`s with same name in different databases. If you create a MV datamap say MV1 in default database, then you could not use the same name(MV1) for defining another MV datamap in any other database. > Test queries: > scala> carbon.sql("create table ratish(id int, name string) stored by 'carbondata'").show(200,false) > ++ > || > ++ > ++ > scala> carbon.sql("insert into ratish select 1,'ram'").show(200,false) > ++ > || > ++ > ++ > scala> carbon.sql("insert into ratish select 2,'ravi'").show(200,false) > ++ > || > ++ > ++ > scala> carbon.sql("insert into ratish select 3,'raghu'").show(200,false) > ++ > || > ++ > ++ > scala> carbon.sql("create datamap radi using 'mv' as select name from ratish").show(200,false) > ++ > || > ++ > ++ > scala> carbon.sql("rebuild datamap radi").show(200,false) > ++ > || > ++ > ++ > scala> carbon.sql("explain select name from ratish").show(200,false) > +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ > |plan | > +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ > |== CarbonData Profiler == > Table Scan on radi_table > - total blocklets: 1 > - filter: none > - pruned by Main DataMap > - skipped blocklets: 0 > | > |== Physical Plan == > *Project [ratish_name#13790 AS name#13818] > +- *BatchedScan CarbonDatasourceHadoopRelation [ Database name :default, Table name :radi_table, Schema :Some(StructType(StructField(ratish_name,StringType,true))) ] default.radi_table[ratish_name#13790]| > +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ > scala> carbon.sql("create database rad").show(200,false) > ++ > || > ++ > ++ > scala> carbon.sql("use rad").show(200,false) > ++ > || > ++ > ++ > scala> carbon.sql("create table ratish(id int, name string) stored by 'carbondata'").show(200,false) > ++ > || > ++ > ++ > scala> carbon.sql("insert into ratish select 1,'ram'").show(200,false) > ++ > || > ++ > ++ > scala> carbon.sql("insert into ratish select 2,'ravi'").show(200,false) > ++ > || > ++ > ++ > scala> carbon.sql("insert into ratish select 3,'raghu'").show(200,false) > ++ > || > ++ > ++ > scala> carbon.sql("create datamap radi using 'mv' as select name from ratish").show(200,false) > java.io.IOException: DataMap with name radi already exists in storage > at org.apache.carbondata.core.metadata.schema.table.DiskBasedDMSchemaStorageProvider.saveSchema(DiskBasedDMSchemaStorageProvider.java:70) > at org.apache.carbondata.core.datamap.DataMapStoreManager.saveDataMapSchema(DataMapStoreManager.java:158) > at org.apache.carbondata.mv.datamap.MVHelper$.createMVDataMap(MVHelper.scala:115) > at org.apache.carbondata.mv.datamap.MVDataMapProvider.initMeta(MVDataMapProvider.scala:53) > at org.apache.spark.sql.execution.command.datamap.CarbonCreateDataMapCommand.processMetadata(CarbonCreateDataMapCommand.scala:118) > at org.apache.spark.sql.execution.command.AtomicRunnableCommand.run(package.scala:90) > at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult$lzycompute(commands.scala:58) > at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult(commands.scala:56) > at org.apache.spark.sql.execution.command.ExecutedCommandExec.executeCollect(commands.scala:67) > at org.apache.spark.sql.Dataset.<init>(Dataset.scala:183) > at org.apache.spark.sql.CarbonSession$$anonfun$sql$1.apply(CarbonSession.scala:108) > at org.apache.spark.sql.CarbonSession$$anonfun$sql$1.apply(CarbonSession.scala:97) > at org.apache.spark.sql.CarbonSession.withProfiler(CarbonSession.scala:155) > at org.apache.spark.sql.CarbonSession.sql(CarbonSession.scala:95) > ... 48 elided > > -- This message was sent by Atlassian JIRA (v7.6.3#76005) |
Free forum by Nabble | Edit this page |