You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@carbondata.apache.org by jackylk <gi...@git.apache.org> on 2016/10/13 17:32:16 UTC

[GitHub] incubator-carbondata pull request #236: [CARBONDATA-Pending] Add dictionary ...

GitHub user jackylk opened a pull request:

    https://github.com/apache/incubator-carbondata/pull/236

    [CARBONDATA-Pending] Add dictionary interface for new data load flow

    In this PR, following is added:
    - a BiDictionary interface which can retrieve key by value, or retrieve value by key.
    - DictionaryGenerator interface that generates dictionary key from value
    - an implementation (InMemBiDictionary) that uses BiMap from Google Guava library as backend data structure. This implementation also supports pre-created dictionary.
    
    Testcase is added for InMemBiDictionary
    
    I will create the JIRA issue later after it is available

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jackylk/incubator-carbondata dict

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-carbondata/pull/236.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 #236
    
----
commit 765aec43db1a94e101f99bd92b8763a3c1989edb
Author: jackylk <ja...@huawei.com>
Date:   2016-10-13T17:24:30Z

    add dictionary interface

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-carbondata pull request #236: [CARBONDATA-299] Add dictionary inte...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-carbondata/pull/236


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-carbondata pull request #236: [CARBONDATA-299] Add dictionary inte...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/236#discussion_r83359748
  
    --- Diff: processing/src/main/java/org/apache/carbondata/processing/newflow/dictionary/InMemBiDictionary.java ---
    @@ -0,0 +1,85 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +
    +package org.apache.carbondata.processing.newflow.dictionary;
    +
    +import java.util.Map;
    +
    +import org.apache.carbondata.core.devapi.DictionaryGenerator;
    +import org.apache.carbondata.core.devapi.GeneratingBiDictionary;
    +
    +import com.google.common.collect.BiMap;
    +import com.google.common.collect.HashBiMap;
    +
    +public class InMemBiDictionary<K, V> extends GeneratingBiDictionary<K, V> {
    --- End diff --
    
    we can add DictionaryCache based implementation. we may not require this implementation now. We can add when we need it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-carbondata pull request #236: [CARBONDATA-299] Add dictionary inte...

Posted by jackylk <gi...@git.apache.org>.
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/236#discussion_r83360819
  
    --- Diff: processing/src/main/java/org/apache/carbondata/processing/newflow/dictionary/InMemBiDictionary.java ---
    @@ -0,0 +1,85 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +
    +package org.apache.carbondata.processing.newflow.dictionary;
    +
    +import java.util.Map;
    +
    +import org.apache.carbondata.core.devapi.DictionaryGenerator;
    +import org.apache.carbondata.core.devapi.GeneratingBiDictionary;
    +
    +import com.google.common.collect.BiMap;
    +import com.google.common.collect.HashBiMap;
    +
    +public class InMemBiDictionary<K, V> extends GeneratingBiDictionary<K, V> {
    --- End diff --
    
    This `InMemBiDictionary` is for one column, when it comes to cache, I think the cached object is 'BiDictionary`. Since the cache provides KV API, so we need a TableDictionary to make use of the cache. I am thinking to add another class for table dictionary, like 
    ```
    CachedTableDictionary tableDict = new CachedTableDictionary(tableName)
    key = tableDict.getOrGenerateKey(columnName, value)
    ```
    Inside `CachedTableDictionary`, it will maintain a cache of `HashMap<columnName, BiDictionary>`
    I am thinking to use [Cache](https://github.com/google/guava/wiki/CachesExplained) from Guava also


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-carbondata pull request #236: [CARBONDATA-299] Add dictionary inte...

Posted by jackylk <gi...@git.apache.org>.
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/236#discussion_r83360359
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/devapi/BiDictionary.java ---
    @@ -0,0 +1,53 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +
    +package org.apache.carbondata.core.devapi;
    +
    +public interface BiDictionary<K, V> {
    --- End diff --
    
    It mean Bidirectional, I borrow the term from Guava library.
    see [BiMap](https://github.com/google/guava/wiki/NewCollectionTypesExplained#bimap)



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-carbondata pull request #236: [CARBONDATA-299] Add dictionary inte...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/236#discussion_r83359504
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/devapi/BiDictionary.java ---
    @@ -0,0 +1,53 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +
    +package org.apache.carbondata.core.devapi;
    +
    +public interface BiDictionary<K, V> {
    --- End diff --
    
    what is the meaning of `Bi`, not understandable


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---