Esempio n. 1
0
        static void Main(string[] args)
        {
            L.Config.WriteTo.PoshConsole();

            if (string.IsNullOrEmpty(AppSettings.Instance.InputFilePath))
            {
                WriteHelp();
            }
            else
            {
                var path = System.IO.Path.Combine(AppContext.BaseDirectory, AppSettings.Instance.InputFilePath);
                _log.D("Input file chosen as {0}", path);

                if (!System.IO.File.Exists(path))
                {
                    _log.E("The path {0} does not exist", path);
                    return;
                }
                else
                {
                    long fileLen = 0;
                    var  dataSet = ReadFromParquetFile(path, out fileLen);

                    // After reading the column types give a printed list of the layout of the columns
                    var display   = new DisplayController();
                    var viewModel = display.Get(dataSet);

                    if (string.Compare(AppSettings.Instance.Mode, "interactive", true) == 0)
                    {
                        new InteractiveConsoleView().Draw(viewModel);
                    }
                    else if (string.Compare(AppSettings.Instance.Mode, "full", true) == 0)
                    {
                        new FullConsoleView().Draw(viewModel);
                    }
                    else if (string.Compare(AppSettings.Instance.Mode, "schema", true) == 0)
                    {
                        new SchemaView().Draw(viewModel);
                    }
                }
            }
        }