Tag: AI

  • Experiments with GitHub CoPilot

    There has been a lot of attention given to ChatGPT and AI over the last month or two. I’ve tried a few things with the public interface at Open.ai. Some worked well, like this one:

    2023-04-29 09_06_27-

    Others not so well:

    2023-04-24 10_26_10-Window

    This post looks at a few things I tried with VS Code and GitHub Copilot.

    Getting Access

    I saw a note in our internal Redgate Slack that all developers were given access to Github Copilot. This is something you can subscribe to for about US$10/month, or if you are a student, you can get it for free. In my case, I filed a ticket:

    2023-04-29 09_08_52-Inbox - steve.jones@red-gate.com - Outlook

    It took a week or so as someone was out on holiday and this was a low priority ticket. In any case, I got a note from our ticket system, as well as GitHub, that I had access:

    2023-04-29 09_10_04-Inbox - steve.jones@red-gate.com - Outlook

    So I added the extension to VSCode.

    2023-04-29 08_58_23-Extension_ GitHub Copilot - sqlsatwebsite - Visual Studio Code

    Once installed, I got a note to sign in to GitHub, and when I had completed that, I saw the Copilot icon in the lower right corner of my IDE.

    2023-04-29 09_11_04-Window

    Getting Started

    My first experiment was to open my ZeroDowntime client code and see what happened. This is a VS 2019 project, but I opened it in VSCode, specifically the form1.cs code. I highlighted some code and …

    Nothing.

    Then I tried something I’d seen. I added a comment above some code. Still nothing, but when I opened the Github Copilot completions panel, I saw this:

    2023-04-29 09_02_27-● Form1.cs - sqlsatwebsite - Visual Studio Code

    Not helpful, nor what I asked for. Both solutions were similar.

    Starting from Scratch

    I decided to then start from scratch. I created a new file, set this to C# and wrote this:

    2023-04-29 09_14_18-● __ write the outline of a console applic • Untitled-1 - sqlsatwebsite - Visual

    Initially I got nothing, but when I opened the Copilot panel I saw this:

    2023-04-29 09_14_46-● __ write the outline of a console applic • Untitled-1 - sqlsatwebsite - Visual

    That is more interesting. Clearly poor specifications on my part.

    Let’s try something else. I added more detail, and as I did, Copilot even added a few things after to help me specify what I needed.

    2023-04-29 09_16_06-● __ write the outline of a console applic • Untitled-1 - sqlsatwebsite - Visual

    I finished these lines and hit enter and I got something, though not what I wanted.

    2023-04-29 09_18_07-● __ write the outline of a console applic • Untitled-1 - sqlsatwebsite - Visual

    Let’s try something else:

    2023-04-29 09_19_22-● __ write the outline of a console applic • Untitled-1 - sqlsatwebsite - Visual

    That’s better. Not great, but better. This doesn’t quite match what I asked for. I copied this to a template project and then added another comment. I want to check for the existence of the parameter, and I got this code, which is better than something I’d write.

    2023-04-29 09_30_22-● Program.cs - sqlsatwebsite - Visual Studio Code

    Not quite right, and I have some lines to delete, but this gives me something, and as a middling C# dev, this is helpful. Once cleaned, I compiled and ran the code, and it seemed to work, at least for a very basic console app.

    2023-04-29 09_37_18-cmd

    Let’s try SQL

    I opened a new file, set the type to SQL and wrote a comment, using the appropriate comment style.

    2023-04-29 09_38_33-● Untitled-1 - sqlsatwebsite - Visual Studio Code

    I guess that’s OK. Not great, but I didn’t provide much detail. Interesting that it chose to use a created_at column with a timestamp. I never use timestamp, which is deprecated. Not sure how the AI learned about this type, perhaps because of a large corpus of training data using old code with this? Who knows.

    Let’s try something else. I’ll ask for a query using a known schema.

    2023-04-29 09_40_29-● Untitled-1 - sqlsatwebsite - Visual Studio Code

    A start, but not quite right. I do have to keep hitting enter to get the query written. A couple more Enters and Tabs to accept code get me this:

    2023-04-29 09_48_03-● Untitled-1 - sqlsatwebsite - Visual Studio Code

    If I keep going, I get a long query, but it doens’t work. At least not on my version of AdventureWorks.

    2023-04-29 09_50_45-SQLQuery2.sql - ARISTOTLE.AdventureWorks (ARISTOTLE_Steve (51))_ - Microsoft SQL

    Not great.

    What if I add a comment? I’ll ask for window functions.

    2023-04-29 09_51_45-● Untitled-1 - sqlsatwebsite - Visual Studio Code

    I get something else, but again, the final query doesn’t work. This time there are less errors, but the join listed seems to think the Customer table has a first name and last name, which it doesn’t.

    Initial Thoughts

    I’m not sure how useful this is. I think this is going to be one of those tools that I’ll have to practice with and understand how it works. My basic tests are mostly because I’m not sure what to do with it, or how it can be helpful.

    I have lightly seen some demos, but I realize that I need to watch a few more and also experiment with the features. I was hoping it would clean up some of my C# code, which is fairly basic, but it didn’t, at least not with my prompts.

    We’ll see how this goes, and I’ll see if I can use it in ADS and if it can actually recognize and use my database schemas to write queries or tests.

  • AI Concerns

    I hosted a webinar a few weeks ago about Artificial Intelligence and how it might affect data professionals. It was an interesting discussion with Kellyn Pot’Vin-Gorman and Brian Randell, with all of us having slightly different perspectives. Overall, we all agree AI is amazing and can be a useful tool for data professionals.

    This week I’ve been in Redmond at the MVP Summit, and AI has been a topic among many MVPs. Lots of jokes have been told, no shortage of which dealt with getting rid of staff. Not that these MVPs want to see less staff, but they know that executives and managers might see all the AI hype about how GitHub CoPilot writes code and think they need less developers.

    I don’t know if that is really how executives will view the world, especially as most IT departments have more work than resources to complete their list of tasks. I can see AI helping get more done, which might mean less hiring (or slower hiring) in the future.

    There was an article this week talking about ways to protect your job in the age of AI hype. It was interesting in that the suggestions all revolve around bringing more value to your job. The suggestions about working in specialized areas, complex areas, being a better employee with documentation, these are all things that I’ve done in my career. It’s what I also see from many MVPs.

    Maybe the most interesting item was to think about incorporating AI into your work now. It’s not necessarily an expert on your work, but it is a tool. As the models absorb more information and become better trained, they can be a level to help you get more work done. They can assist you in tedious work, which is something many of us can benefit from.

    I am looking forward to getting access to CoPilot and keeping an AI tool up on my desktop, learning how it might help me, and maybe more importantly, where it won’t help me.

    I can’t stop this trend, but I can better understand it and learn how it might fit with my daily work. Knowing that helps me better understand how I might have an informed and rational discussion with management about the advantages or disadvantages of this new technology.

    Steve Jones

  • A Prompt Engineer

    No, Redgate Software isn’t hiring for SQL Prompt. I’m sure quite a few of you depend on SQL Prompt and would like more engineers working on it. Maybe a few of you would find that an interesting piece of software to work on.

    Rather, a Prompt engineer is someone that works with AI, trying to get a system to produce better results. I can’t decide if this sounds like an interesting job that stretches your brain or the equivalent of a mediocre developer that just keeps copying something from Stack Overflow, hitting compile, getting an error, and repeating that cycle.

    I can picture a scientist using their voice to continually correct some AI system by saying “no, that’s not quite right. I want to see more blue” or some other type of guidance. Is this job the equivalent of raising a digital toddler?

    I actually found one of these jobs on Indeed.com. For a company in San Francisco, a hybrid position paying between US$175k-335k to help create steerable AI systems. I’m not entirely sure what this is, but at that pay rate, it is tempting to learn.

    I think AI systems are fascinating, especially for someone that has done some development and can see how difficult it would be to specify an algorithm that can handle some tasks. Like composing some prose result. Or suggesting code based on what you’ve typed. These are some handy features that have been added to some IDEs and services.

    GitHub CoPilot is interesting, and if you haven’t tried it, I think it helps Java/C#/app programmers. Go watch some videos or sign up for a trial. I am not sure about these helping us in database work. There is probably a little more work needed before an AI delivers help for your particular database issue. However, I’ll be testing and working with some tools to see what I think.

    If you are interested in AI and have a lot of patience to train models, and a lot of patience to work on data cleansing and loading, then maybe you can find a new career in AI. It might be a fad, but I don’t think it will ever go away, and I do think there will be a lot of opportunities in this space in the next decade.

    Note: If you find this interesting, I had a discussion recently with a few others in a webinar.

    Steve Jones

    Listen to the podcast at Libsyn, Stitcher, Spotify, or iTunes.

  • Autonomous Driving Around London

    There’s a video of Bill Gates taking a drive in an autonomous car around London. I’ve been to London dozens of times, ridden and cabs and Ubers, and even driven a few times. It’s a crazy environment, and I struggle to process everything as a human. This is certainly a challenge for a car.

    It’s not a Tesla. In fact, I don’t see many Tesla FSD (full self driving) videos in the UK. I know they don’t have all the updates the US gets, but I struggled to find any actually in London. A few that looked like they were close to London aborted in city driving.

    In any case, this is a neat video, and if you look at all the things happening, as a driver, you can see the complexity of navigating around London. Imagine programming this.

    If the video doesn’t tender, the URL is here: https://www.youtube.com/watch?v=ruKJCiAOmfg&w=560&h=315

    This is a car from Wayve, and it is impressive. Not the car, but the driving and control are something. It’s something I’d like to experience, since I could imagine this being a very neat thing in witness. Certainly would be better than the Uber I took in Las Vegas a few years ago.

    They’re hiring. Not for me, but maybe for you.