示例#1
0
        /// <summary>
        /// Write the textual representation of the record schema to the writer.
        /// </summary>
        /// <remarks>If the header or records have already been written, this call is ignored.</remarks>
        public async Task WriteSchemaAsync()
        {
            if (isSchemaWritten)
            {
                return;
            }
            if (recordWriter.Metadata.Schema != null)
            {
                await recordWriter.WriteSchemaAsync();

                await recordWriter.WriteRecordSeparatorAsync();

                ++recordWriter.Metadata.RecordCount;
            }
            isSchemaWritten = true;
        }
示例#2
0
        /// <summary>
        /// Write the textual representation of the record schema to the writer.
        /// </summary>
        /// <remarks>If the header or records have already been written, this call is ignored.</remarks>
        public async Task WriteSchemaAsync()
        {
            if (isSchemaWritten)
            {
                return;
            }
            if (recordWriter.Metadata.ExecutionContext.Schema != null)
            {
                await recordWriter.WriteSchemaAsync().ConfigureAwait(false);

                await recordWriter.WriteRecordSeparatorAsync().ConfigureAwait(false);

                ++recordWriter.Metadata.PhysicalRecordNumber;
            }
            isSchemaWritten = true;
        }
示例#3
0
        /// <summary>
        /// Writes the textual representation of the given values to the writer.
        /// </summary>
        /// <param name="values">The values to write.</param>
        /// <exception cref="System.ArgumentNullException">The values array is null.</exception>
        public async Task WriteAsync(object[] values)
        {
            if (values == null)
            {
                throw new ArgumentNullException("values");
            }
            if (isFirstLine)
            {
                if (recordWriter.Options.IsFirstRecordSchema && recordWriter.Schema != null)
                {
                    await recordWriter.WriteSchemaAsync();

                    await recordWriter.WriteRecordSeparatorAsync();
                }
                isFirstLine = false;
            }
            await recordWriter.WriteRecordAsync(values);

            await recordWriter.WriteRecordSeparatorAsync();
        }