Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Proposal: Add an option to pilosa import command that can auto create new indexes/frames #765

Closed
addos opened this issue Aug 12, 2017 · 10 comments · Fixed by #837
Closed
Assignees

Comments

@addos
Copy link

addos commented Aug 12, 2017

Description

Hi, I have been using pilosa for awhile now, and one of the things I've found would be really helpful would be if the pilosa import command could have some way to automatically create new indexes and new frames, perhaps with an extra parameter of some kind, or maybe it can just automatically detect if an index/frame already exists and if not create it? I personally feel this would make importing data into pilosa require fewer steps and would accomodate the majority of what I need for the data I am importing.

Success criteria (What criteria will consider this ticket closeable?)

pilosa import -i newIndexName -f newFrameName filename.csv automatically creates a new index with the default column name, and automatically creates a new frame with the default row name, and otherwise uses an existing index/frame if they already exist.

Thanks for your consideration and keep up the great work!

@travisturner
Copy link
Member

This would be fairly easy to implement in ImportCommand.Run() by adding:

err := cmd.Client.CreateIndex(ctx, cmd.Index, pilosa.IndexOptions{})
err := cmd.Client.CreateFrame(ctx, cmd.Frame, pilosa.FrameOptions{})

(obviously handling the errors and likely ignoring ErrIndexExists and ErrFrameExists)

The only thing I question is whether this should be the default behavior (i.e. indexes/frames automatically get created when they don't exist), or whether we should add a boolean flag to the import command (that defaults to false) indicating that indexes/frames should be created when they don't exists: --auto-create-index or something like that.

@addos
Copy link
Author

addos commented Aug 14, 2017

The only other thing I thought about, was also whether to create an inverse index. Not sure whether it is worth having that as another option.

@jaffee
Copy link
Member

jaffee commented Aug 14, 2017

Not only the inverse index, but what cache type and size to use on the frame. I don't really see much issue with adding these as options as well because it seems like it will be pretty low effort, and this is really just a stopgap until better import/export support comes via #725

If we add a boolean flag as @travisturner suggested (--create?) which defaults to false, we can preserve backward compatibility with older versions of the command which seems worthwhile.

@addos
Copy link
Author

addos commented Aug 14, 2017

Well, and from my perspective, anything that makes it quicker to import data into pilosa is a huge win. So all of this sounds good to me. 👍

@travisturner
Copy link
Member

It makes sense to me to treat this as a stopgap—and not support index/frame options—for now.
And I am supportive of the --create flag for backward compatibility.

@jaffee
Copy link
Member

jaffee commented Aug 15, 2017

@addos would this solve your problem with all defaults, or do you need to be able to specify cache type and size?

@addos
Copy link
Author

addos commented Aug 15, 2017

So the primary goal was to reduce the friction to getting data into the index. The extra options would be nice. At a minimum having it use the defaults is better than having to create the index and frame manually as separate steps.

@travisturner
Copy link
Member

Let's implement this and include command line flags for frame options.

    string RowLabel = 1;
    bool InverseEnabled = 2;
    string CacheType = 3;
    uint32 CacheSize = 4;
    string TimeQuantum = 5;
    bool RangeEnabled = 6;

@jaffee
Copy link
Member

jaffee commented Aug 30, 2017

@addos if you have any interest in contributing this change, I'd be happy to walk you through it. If not, I'll go ahead and knock it out.

@addos
Copy link
Author

addos commented Aug 31, 2017

Not sure how I would do that.

@yuce yuce self-assigned this Sep 20, 2017
@yuce yuce closed this as completed in #837 Sep 25, 2017
yuce added a commit that referenced this issue Sep 25, 2017
Enables auto-creating the schema on imports; Resolves #765
seebs pushed a commit to seebs/pilosa that referenced this issue Nov 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants