Beispiel #1
0
        public override string GenerateFile(out UploadInfo uploadInfo)
        {
            var nowAsString = DateTime.UtcNow.ToString(DateTimeFormat, CultureInfo.InvariantCulture);

            uploadInfo = new UploadInfo
            {
                FileName   = $"{nowAsString}-{_fileNameSuffix}.{Extension}",
                FolderName = _remoteFolderName,
            };

            var localPath = Path.Combine(_tmpFilePath, _localFolderName ?? string.Empty, uploadInfo.FileName);

            if (_localFolderName != null)
            {
                Directory.CreateDirectory(Path.Combine(_tmpFilePath, _localFolderName));
            }

            using (Stream fileStream = File.Open(localPath, FileMode.OpenOrCreate, FileAccess.ReadWrite))
                using (var parquetWriter = new ParquetWriter(new Schema(Fields.Values), fileStream))
                {
                    WriteGroup(parquetWriter);
                }

            _count = _group.Count;
            _group.Clear();

            return(localPath);
        }
Beispiel #2
0
 public abstract string GenerateFile(out UploadInfo uploadInfo);