Skip to content

Commit

Permalink
ContextPtr & -> const ContextPtr &
Browse files Browse the repository at this point in the history
  • Loading branch information
zliang-min committed Jul 4, 2024
1 parent 7d06da9 commit 8d9829e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/Formats/FormatFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,9 @@ bool FormatFactory::checkIfFormatHasExternalSchemaWriter(const String & name)
return static_cast<bool>(target.external_schema_writer_creator);
}

ExternalSchemaWriterPtr FormatFactory::getExternalSchemaWriter(const String & name,
ContextPtr & context,
ExternalSchemaWriterPtr FormatFactory::getExternalSchemaWriter(
const String & name,
const ContextPtr & context,
std::optional<FormatSettings> _format_settings) const
{
const auto & external_schema_writer_creator = dict.at(name).external_schema_writer_creator;
Expand Down
2 changes: 1 addition & 1 deletion src/Formats/FormatFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class FormatFactory final : private boost::noncopyable

ExternalSchemaWriterPtr getExternalSchemaWriter(
const String & name,
ContextPtr & context,
const ContextPtr & context,
std::optional<FormatSettings> format_settings = std::nullopt) const;
/// proton: ends

Expand Down
4 changes: 2 additions & 2 deletions src/Formats/FormatSchemaFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ String basename(const std::filesystem::path & path)

}

void FormatSchemaFactory::registerSchema(const String & schema_name, const String & format, std::string_view schema_body, ExistsOP exists_op, ContextPtr & context)
void FormatSchemaFactory::registerSchema(const String & schema_name, const String & format, std::string_view schema_body, ExistsOP exists_op, const ContextPtr & context)
{
assert(!schema_name.empty());
assert(!format.empty());
Expand Down Expand Up @@ -60,7 +60,7 @@ void FormatSchemaFactory::registerSchema(const String & schema_name, const Strin
throw Exception(ErrorCodes::FORMAT_SCHEMA_ALREADY_EXISTS, "Format schema {} of type {} already exists", schema_name, format);
}

void FormatSchemaFactory::unregisterSchema(const String & schema_name, const String & format, bool throw_if_not_exists, ContextPtr & context)
void FormatSchemaFactory::unregisterSchema(const String & schema_name, const String & format, bool throw_if_not_exists, const ContextPtr & context)
{
assert(!schema_name.empty());

Expand Down
4 changes: 2 additions & 2 deletions src/Formats/FormatSchemaFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ class FormatSchemaFactory final : private boost::noncopyable

static FormatSchemaFactory & instance();

void registerSchema(const String & schema_name, const String & format, std::string_view schema_body, ExistsOP exists_op, ContextPtr & context);
void registerSchema(const String & schema_name, const String & format, std::string_view schema_body, ExistsOP exists_op, const ContextPtr & context);

void unregisterSchema(const String & schema_name, const String & format, bool throw_if_not_exists, ContextPtr & context);
void unregisterSchema(const String & schema_name, const String & format, bool throw_if_not_exists, const ContextPtr & context);

struct SchemaEntry
{
Expand Down

0 comments on commit 8d9829e

Please sign in to comment.