Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage Blob Stg78 Features #3650

Merged
merged 30 commits into from
May 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
702382d
query blob
Jinming-Hu May 9, 2022
e191f6f
support for empty xml text
Jinming-Hu May 11, 2022
a0504f9
identify record and fixed by name
Jinming-Hu May 11, 2022
cfd67f3
add large test case
Jinming-Hu May 11, 2022
79b1b10
arrow
Jinming-Hu May 13, 2022
7bf15e9
update API version to 2020-10-02
Jinming-Hu May 14, 2022
c6e14cd
parquet test case
Jinming-Hu May 14, 2022
e3d5cb0
List Delete Root Blob With Versions
Jinming-Hu May 14, 2022
ae9898a
system containers
Jinming-Hu May 14, 2022
356359f
pageable GetPageRanges()
Jinming-Hu May 14, 2022
d2869ce
error handling and progress
Jinming-Hu May 15, 2022
02afb30
doxygen
Jinming-Hu May 15, 2022
eabb835
access conditions
Jinming-Hu May 15, 2022
8610854
small fix
Jinming-Hu May 16, 2022
b768e3b
record
Jinming-Hu May 16, 2022
cd2d4e9
Merge remote-tracking branch 'upstream/main' into stg78
Jinming-Hu May 16, 2022
ce105e7
fix typo
Jinming-Hu May 16, 2022
1e93c49
Changelog
Jinming-Hu May 16, 2022
f598138
fix warnings
Jinming-Hu May 16, 2022
7b7231c
fix more
Jinming-Hu May 16, 2022
e12f07f
fix warnings
Jinming-Hu May 16, 2022
5894511
move template specialization out of class
Jinming-Hu May 16, 2022
ea937ee
test live only
Jinming-Hu May 16, 2022
cfad6c2
debug
Jinming-Hu May 16, 2022
e93d915
debug2
Jinming-Hu May 16, 2022
ad07577
debug3
Jinming-Hu May 16, 2022
f54f46c
remove debug info
Jinming-Hu May 16, 2022
3f77c79
update API version
Jinming-Hu May 16, 2022
cbaef3a
disable failed test cases
Jinming-Hu May 16, 2022
a798e02
update recording
Jinming-Hu May 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions sdk/storage/azure-storage-blobs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

### Features Added

- Bumped up API version to `2020-10-02`.
- Added new API: `BlockBlobClient::Query()`.
- Added `ContinuationToken` and `PageSizeHint` in `GetPageRangesOptions`.
- Added support for listing system containers.
- Added support for listing deleted root blob with active versions.

katmsft marked this conversation as resolved.
Show resolved Hide resolved
### Breaking Changes

### Bugs Fixed
Expand Down
3 changes: 3 additions & 0 deletions sdk/storage/azure-storage-blobs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ set(
inc/azure/storage/blobs/page_blob_client.hpp
inc/azure/storage/blobs/rest_client.hpp
inc/azure/storage/blobs.hpp
src/private/avro_parser.hpp
src/private/package_version.hpp
)

Expand All @@ -62,11 +63,13 @@ set(
src/blob_client.cpp
src/blob_container_client.cpp
src/blob_lease_client.cpp
src/blob_options.cpp
src/blob_responses.cpp
src/blob_sas_builder.cpp
src/blob_service_client.cpp
src/block_blob_client.cpp
src/page_blob_client.cpp
src/private/avro_parser.cpp
src/rest_client.cpp
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,154 @@ namespace Azure { namespace Storage { namespace Blobs {
} AccessConditions;
};

/**
* @brief Blob Query text configuration for input.
*/
class BlobQueryInputTextOptions final {
public:
/**
* @brief Creates CSV text configuration.
*
* @param recordSeparator Record separator.
* @param columnSeparator Column sepeartor.
* @param quotationCharacter Field quote.
* @param escapeCharacter Escape character.
* @param hasHeaders If CSV file has headers.
* @return CSV text configuration.
*/
static BlobQueryInputTextOptions CreateCsvTextOptions(
const std::string& recordSeparator = std::string(),
const std::string& columnSeparator = std::string(),
const std::string& quotationCharacter = std::string(),
const std::string& escapeCharacter = std::string(),
bool hasHeaders = false);
/**
* @brief Creates Json text configuration.
*
* @param recordSeparator Record separator.
* @return Json text configuration.
*/
static BlobQueryInputTextOptions CreateJsonTextOptions(
const std::string& recordSeparator = std::string());
/**
* @brief Creates Parquet text configuration.
*
* @return Parquet text configuration
*/
static BlobQueryInputTextOptions CreateParquetTextOptions();

private:
Models::_detail::QueryFormatType m_format;
std::string m_recordSeparator;
std::string m_columnSeparator;
std::string m_quotationCharacter;
std::string m_escapeCharacter;
bool m_hasHeaders = false;

friend class BlockBlobClient;
};

/**
* @brief Blob Query text configuration for output.
*/
class BlobQueryOutputTextOptions final {
public:
/**
* @brief Creates CSV text configuration.
*
* @param recordSeparator Record separator.
* @param columnSeparator Column sepeartor.
* @param quotationCharacter Field quote.
* @param escapeCharacter Escape character.
* @param hasHeaders If CSV file has headers.
* @return CSV text configuration.
*/
static BlobQueryOutputTextOptions CreateCsvTextOptions(
const std::string& recordSeparator = std::string(),
const std::string& columnSeparator = std::string(),
const std::string& quotationCharacter = std::string(),
const std::string& escapeCharacter = std::string(),
bool hasHeaders = false);
/**
* @brief Creates Json text configuration.
*
* @param recordSeparator Record separator.
* @return Json text configuration.
*/
static BlobQueryOutputTextOptions CreateJsonTextOptions(
const std::string& recordSeparator = std::string());
/**
* @brief Creates Arrow text configuration.
*
* @param schema A list of fields describing the schema.
* @return Arrow text configuration.
*/
static BlobQueryOutputTextOptions CreateArrowTextOptions(
std::vector<Models::BlobQueryArrowField> schema);

private:
Models::_detail::QueryFormatType m_format;
std::string m_recordSeparator;
std::string m_columnSeparator;
std::string m_quotationCharacter;
std::string m_escapeCharacter;
bool m_hasHeaders = false;
std::vector<Models::BlobQueryArrowField> m_schema;

friend class BlockBlobClient;
};

/**
* @brief Blob Query Error.
*/
struct BlobQueryError final
{
/**
* @brief Error name.
*/
std::string Name;
/**
* @brief Error description.
*/
std::string Description;
/**
* @brief If the error is a fatal error.
*/
bool IsFatal = false;
/**
* The position of the error..
*/
int64_t Position;
};

/**
* @brief Optional parameters for #Azure::Storage::Blobs::BlockBlobClient::Query.
*/
struct QueryBlobOptions final
{
/**
* @brief Input text configuration.
*/
BlobQueryInputTextOptions InputTextConfiguration;
/**
* @brief Output text configuration.
*/
BlobQueryOutputTextOptions OutputTextConfiguration;
/**
* @brief Optional conditions that must be met to perform this operation.
*/
BlobAccessConditions AccessConditions;
/**
* @brief Callback for progress handling.
*/
std::function<void(int64_t, int64_t)> ProgressHandler;
/**
* @brief Callback for error handling. If you don't specify one, the default will be used, which
* will ignore all non-fatal errors and throw for fatal errors.
*/
std::function<void(BlobQueryError)> ErrorHandler;
};

/**
* @brief Optional parameters for #Azure::Storage::Blobs::AppendBlobClient::Create.
*/
Expand Down Expand Up @@ -1275,6 +1423,22 @@ namespace Azure { namespace Storage { namespace Blobs {
* @brief Optional conditions that must be met to perform this operation.
*/
BlobAccessConditions AccessConditions;

/**
* @brief This parameter identifies the portion of the ranges to be returned with the next
* operation. The operation returns a marker value within the response body if the ranges
* returned were not complete. The marker value may then be used in a subsequent call to request
* the next set of ranges.This value is opaque to the client.
*/
Azure::Nullable<std::string> ContinuationToken;

/**
* @brief This parameter specifies the maximum number of page ranges to return. If the request
* specifies a value greater than 10000, the server will return up to 10000 items. If there are
* additional results to return, the service returns a continuation token in the NextMarker
* response element.
*/
Azure::Nullable<int32_t> PageSizeHint;
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,19 @@ namespace Azure { namespace Storage { namespace Blobs {
const GetBlockListOptions& options = GetBlockListOptions(),
const Azure::Core::Context& context = Azure::Core::Context()) const;

/**
* @brief Returns the result of a query against the blob.
*
* @param querySqlExpression The query expression in SQL.
* @param options Optional parameters to execute this function.
* @param context Context for cancelling long running operations.
* @return A QueryBlobResult describing the query result.
*/
Azure::Response<Models::QueryBlobResult> Query(
const std::string& querySqlExpression,
const QueryBlobOptions& options = QueryBlobOptions(),
const Azure::Core::Context& context = Azure::Core::Context()) const;

private:
explicit BlockBlobClient(BlobClient blobClient);
friend class BlobClient;
Expand Down
Loading