CreateTableIfNotExists documentation ambiguous and example is WRONG
Type of issue
Other (describe below)
Description
CreateTableIfNotExists(tableName) should return a TableClient if table already exist, though documentation here is ambiguous in the case when a table exists.
Other documentation (azure-sdk-for-java/sdk/tables /azure-data-tables/ IS explicit: Create a table
Create a table by calling the TableServiceClient's createTable method. A TableClient will be returned, this client allows performing operations on the table. An exception will be thrown if a table with the provided name exists.
TableClient tableClient = tableServiceClient.createTable(tableName);
Alternatively, you can call the createTableIfNotExists method which will create the table only if no such table exists, and does not throw an exception. A TableClient will be returned as well.
TableClient tableClient = tableServiceClient.createTableIfNotExists(tableName);
And that behavior is consistent with supposedly obsolete Storage 8.6.6.
BUT "new" Library returns null if table already exists.
What good is it to RTFM when TFM is WRONG.
Page URL
https://learn.microsoft.com/en-us/java/api/com.azure.data.tables.tableserviceclient?view=azure-java-stable#com-azure-data-tables-tableserviceclient-listtables()
Content source URL
https://github.com/Azure/azure-docs-sdk-java/blob/master/docs-ref-autogen/com.azure.data.tables.TableServiceClient.yml
Document Version Independent Id
7caaef32-5972-32f7-f72a-cc025b389068
Article author
@rloutlaw
Metadata
- ID: 1571c383-fd77-a979-2e40-8554fcc7f6ae
Thank you for your feedback. Tagging and routing to the team member best able to assist.
@CaymanTurtleBeach Thank you for reaching out. I will look into your issue and respond shortly.
@CaymanTurtleBeach Thank you for your issue.
I will update the documentation for createTableIfNotExists to include the expected outcome in the case where the Table already exists. Additionally, I will also address the improper return value.