Skip to content

Support enums in relational operations - #3012

Merged
g31pranjal merged 6 commits into
FoundationDB:mainfrom
g31pranjal:support_enum_in_relops
Jan 22, 2025
Merged

g31pranjal merged 6 commits into
FoundationDB:mainfrom
g31pranjal:support_enum_in_relops

Conversation

@g31pranjal

@g31pranjal g31pranjal commented Jan 3, 2025 •

Copy link
Copy Markdown
Member

fixes #3011

@g31pranjal
g31pranjal requested a review from normen662 January 3, 2025 15:02
@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of fdb-record-layer-pr on Linux CentOS 7

  • Commit ID: 22d4ae7
  • Duration 0:49:12
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@g31pranjal
g31pranjal force-pushed the support_enum_in_relops branch from 24bc744 to 352a83d Compare January 14, 2025 16:32
@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of fdb-record-layer-pr on Linux CentOS 7

  • Commit ID: 24bc744
  • Duration 0:51:55
  • Result: ❌ FAILED
  • Error: Error while executing command: ./gradlew --no-daemon --console=plain -b ./build.gradle build destructiveTest -PcoreNotStrict -PreleaseBuild=false -PpublishBuild=false -PspotbugsEnableHtmlReport. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of fdb-record-layer-pr on Linux CentOS 7

  • Commit ID: 352a83d
  • Duration 0:50:46
  • Result: ❌ FAILED
  • Error: Error while executing command: ./gradlew --no-daemon --console=plain -b ./build.gradle build destructiveTest -PcoreNotStrict -PreleaseBuild=false -PpublishBuild=false -PspotbugsEnableHtmlReport. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@g31pranjal
g31pranjal force-pushed the support_enum_in_relops branch from 352a83d to c59de90 Compare January 15, 2025 00:00
@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of fdb-record-layer-pr on Linux CentOS 7

  • Commit ID: c59de90
  • Duration 0:49:59
  • Result: ❌ FAILED
  • Error: Error while executing command: ./gradlew --no-daemon --console=plain -b ./build.gradle build destructiveTest -PcoreNotStrict -PreleaseBuild=false -PpublishBuild=false -PspotbugsEnableHtmlReport. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of fdb-record-layer-pr on Linux CentOS 7

  • Commit ID: 207fa35
  • Duration 0:54:48
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

*/
@API(API.Status.EXPERIMENTAL)
public class FieldValue extends AbstractValue implements ValueWithChild {
public class FieldValue extends AbstractValue implements ValueWithChild, CreatesDynamicTypesValue {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should not be necessary, the inner type should already have been declared elsewhere.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, made PromoteValue to inherit CreatesDynamicTypesValue .

NONE_TO_ARRAY(Type.TypeCode.NONE, Type.TypeCode.ARRAY, (descriptor, in) -> in),
NULL_TO_ENUM(Type.TypeCode.NULL, Type.TypeCode.ENUM, (descriptor, in) -> null),
STRING_TO_ENUM(Type.TypeCode.STRING, Type.TypeCode.ENUM, ((descriptor, in) -> ((Descriptors.EnumDescriptor)descriptor).findValueByName((String)in)));
STRING_TO_ENUM(Type.TypeCode.STRING, Type.TypeCode.ENUM, ((descriptor, in) -> stringToEnumValue((Descriptors.EnumDescriptor) descriptor, (String) in)));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
STRING_TO_ENUM(Type.TypeCode.STRING, Type.TypeCode.ENUM, ((descriptor, in) -> stringToEnumValue((Descriptors.EnumDescriptor) descriptor, (String) in)));
STRING_TO_ENUM(Type.TypeCode.STRING, Type.TypeCode.ENUM, ((descriptor, in) -> stringToEnumValue((Descriptors.EnumDescriptor)descriptor, (String)in)));

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of fdb-record-layer-pr on Linux CentOS 7

  • Commit ID: 16b1a03
  • Duration 0:56:08
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

- query: SELECT * From TABLE_A where "mood" IS NULL
- unorderedResult: [{14, 'alice', !null },
{15, 'bob', !null }]
-

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add an inequality with a string, i.e. "mood" < "something"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of fdb-record-layer-pr on Linux CentOS 7

  • Commit ID: 471e0e1
  • Duration 0:54:30
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@g31pranjal
g31pranjal merged commit 248f109 into FoundationDB:main Jan 22, 2025
@ScottDugas ScottDugas added the enhancement New feature or request label Feb 17, 2025
@ScottDugas ScottDugas changed the title Support enums in rel ops Support enums in relational operations Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support enums in rel ops

4 participants