Skip to content

Conversation

@carlos-rodrigues-8x8
Copy link
Contributor

@carlos-rodrigues-8x8 carlos-rodrigues-8x8 commented Oct 28, 2025

What does this PR do?

This PR aims to fix an error when creating an index a second time when using the clause IF NOT EXISTS

Motivation

Improving Arcadedb

Related issues

#1601
#1819

Additional Notes

It is necessary to refactor code under com.arcadedb.query.sql.parser. Found unused code and code that could be simplified.

Checklist

  • I have run the build using mvn clean package command
  • My unit tests cover both failure and success scenarios

Fixing issue on creating indexes on edges
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @carlos-rodrigues-8x8, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical bug in index creation within Arcadedb where the IF NOT EXISTS clause was not functioning as intended, causing errors when users tried to create an index that already existed. The change ensures that the database schema builder correctly processes this clause, preventing redundant index creation attempts from failing and improving the overall stability and user experience when managing database indexes.

Highlights

  • Index Creation Fix: Resolved an issue where the IF NOT EXISTS clause was not properly respected during index creation, leading to errors when attempting to create an already existing index.
  • Schema Builder Enhancement: Integrated the ifNotExists flag into the buildTypeIndex schema builder, ensuring that index creation correctly handles the IF NOT EXISTS condition.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mergify
Copy link
Contributor

mergify bot commented Oct 28, 2025

🧪 CI Insights

Here's what we observed from your CI run for 3ad0531.

🟢 All jobs passed!

But CI Insights is watching 👀

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly passes the ifNotExists flag to the TypeIndexBuilder, which should resolve the issue of creating an index with IF NOT EXISTS when it already exists. I've added a comment suggesting a further simplification by removing a now-redundant check in CreateIndexStatement.java.

Additionally, I've noticed a potential critical issue in CreateIndexStatement.java that is outside of the current changes. The automatic generation of index names on line 81 appears to be buggy and could cause a NullPointerException when creating an index on record attributes like @out or @in, because Property.toString() is called on a list of properties, and it unconditionally calls toString() on a name field that can be null. This is worth investigating in a separate change.

@carlos-rodrigues-8x8
Copy link
Contributor Author

@robfrank @lvca can you take a look on this PR? Thanks.

@lvca lvca self-requested a review October 28, 2025 15:06
@lvca lvca added the bug Something isn't working label Oct 28, 2025
@lvca lvca added this to the 25.10.1 milestone Oct 28, 2025
@lvca
Copy link
Contributor

lvca commented Oct 28, 2025

Great, thanks!

@lvca lvca merged commit 96f4752 into ArcadeData:main Oct 28, 2025
10 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants