You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "piyushdubey (via GitHub)" <gi...@apache.org> on 2024/03/19 02:51:45 UTC

[I] [C#] Need pointers on creating Columns with values (values = ArrowArray) of type Timestamp and Decimal [arrow]

piyushdubey opened a new issue, #40657:
URL: https://github.com/apache/arrow/issues/40657

   ### Describe the usage question you have. Please include as many useful details as  possible.
   
   
   Hello,
   
   I am looking to understand how to create Columns with values of following types 
   - Timestamp 
   - Decimal
   
   While reading this code in a DateFrame, I am getting an exception with message = `decimal256` for Decimal and `timestamp` for Timestamp.
   
   Super confusing. Appreciate any help with this
   
   Code
   ```
   # Create DECIMAL Column
   ########################
   public CreateDecimalColumn() {
   
   Decimal256Type decimal256Type = new Decimal256Type(10, 3)
   var builder = new Decimal256Array.Builder(decimal256Type);
   CreateColumn<decimal>(
       values: values,
       nullable: nullable,
       appendRange: (vals) => { builder.AppendRange(vals); },
       appendValue: (val) => { builder.Append(val); },
       appendNull: () => { builder.AppendNull(); });
   return builder.Build(memoryAllocator);*/
   }
   
   
   # Create TIMESTAMP Column
   ##########################
   public CreateTimestampColumn() {
   
   var builder = new TimestampArray.Builder();
   CreateColumn<DateTimeOffset>(
       values: values,
       nullable: nullable,
       appendRange: (vals) => { builder.AppendRange(vals); },
       appendValue: (val) => { builder.Append(val); },
       appendNull: () => { builder.AppendNull(); });
   return builder.Build(memoryAllocator);*/
   }
   
   
   # Helper Method / Common code
   #############################
   public void CreateColumn(object values, bool nullable, Action<IList<T> appendRange, Action<T> appendValue, Action appendValue)
   if (!nullable)
   {
       appendRange((IList<T>)values);
       return;
   }
   
   foreach (var value in (IList<T?>)values)
   {
       if (value.HasValue)
       {
           appendValue(value.Value);
       }
       else
       {
           appendNull();
       }
   }
   ```
   
   ### Component(s)
   
   C#


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [C#] Need pointers on creating Columns with values (values = ArrowArray) of type Timestamp and Decimal [arrow]

Posted by "CurtHagenlocher (via GitHub)" <gi...@apache.org>.
CurtHagenlocher closed issue #40657: [C#] Need pointers on creating Columns with values (values = ArrowArray) of type Timestamp and Decimal
URL: https://github.com/apache/arrow/issues/40657


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [C#] Need pointers on creating Columns with values (values = ArrowArray) of type Timestamp and Decimal [arrow]

Posted by "CurtHagenlocher (via GitHub)" <gi...@apache.org>.
CurtHagenlocher commented on issue #40657:
URL: https://github.com/apache/arrow/issues/40657#issuecomment-3549138238

   Closing as stale


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [C#] Need pointers on creating Columns with values (values = ArrowArray) of type Timestamp and Decimal [arrow]

Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic commented on issue #40657:
URL: https://github.com/apache/arrow/issues/40657#issuecomment-3547493020

   This issue has been marked as stale because it has had no activity in the past 365 days. Please remove the stale label or comment below, or this issue will be closed in 14 days. If this usage question has evolved into a feature request or docs update, please remove the 'Type: usage' label and add the 'Type: enhancement' label instead.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org