microsoft / microsoft/Power-Fx

Support Scalar Table Functions via IR transforms

Open
#874 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
3.4k
Forks
358
Avg merge
10h 34m
Merged PRs (30d)
3

Description

Interpreter doesn't support Trig Table Functions today
https://github.com/microsoft/Power-Fx/blob/ac5f76c2f4cc53398d424356a0ae260b87dd93d3/src/tests/Microsoft.PowerFx.Interpreter.Tests/InterpreterExpressionTestCases/Disabled.txt#L3

For 1-argument scalars, we could enable these via an IR transform:
Cos([1,2,3]) // Table overload

Could be rewritten in IR as:
ForAll([1,2,3], Cos(Value)) // ForAll around scalar overload

This can be immediately applied to enabling in interpreter:
https://github.com/microsoft/Power-Fx/blob/main/src/tests/Microsoft.PowerFx.Core.Tests/ExpressionTestCases/TrigTableFunctions.txt

Other table overloads are more complex and can be dealt with later.

Tabular As Scalar Notes
Cos(table) ForAll(table, Cos(Value)) Trivial
Round(table, arg1) ForAll(table, Round(Value, arg1)) 1 arg
Round(table0, table1) ??? 2 tables, complex

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/tests/Microsoft.PowerFx.Interpreter.Tests/InterpreterExpressionTestCases/Disabled.txt and the trig cases in src/tests/Microsoft.PowerFx.Core.Tests/ExpressionTestCases/TrigTableFunctions.txt. Trace the interpreter's IR transform entry point and how ForAll and scalar overloads are represented. Done means one-argument scalar table overloads, such as Cos(table), are enabled with passing expression tests; multi-table overloads remain out of scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
compilers, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.