[ 
https://issues.apache.org/jira/browse/ARROW-2767?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16529304#comment-16529304
 ] 

Brian Hulette edited comment on ARROW-2767 at 7/2/18 1:11 AM:
--------------------------------------------------------------

We could also do
{code:javascript}
class Table<T extends {[name: string]: any}> {
    ...
    getColumn(name: keyof T): Vector<T[name]> {
    }
    ...
}
{code}

Although I'm not sure the {{T[name]}} lookup will actually work.


was (Author: bhulette):
{code:javascript}
class Table<T extends {[name: string]: any}> {
    ...
    getColumn(name: keyof T): Vector<T[name]> {
    }
    ...
}
{code}

Although I'm not sure the {{T[name]}} lookup will actually work.

> [JS] Add generic to Table for column names
> ------------------------------------------
>
>                 Key: ARROW-2767
>                 URL: https://issues.apache.org/jira/browse/ARROW-2767
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: JavaScript
>            Reporter: Brian Hulette
>            Priority: Major
>
> Requested by [~domoritz]
> Something like:
> {code:javascript}
> class Table<ColName extends string = string> {
>     ...
>     getColumn(name: ColName): Vector<any> {
>     }
>     ...
> }
> {code}
> It would be even better if we could find a way to map the column names to the 
> actual vector data types, but one thing at a time.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to